wails-template-vue/frontend/packages/javascript/src/router/index.js

28 lines
610 B
JavaScript
Raw Normal View History

2021-11-15 03:07:00 +08:00
import { createRouter, createWebHashHistory } from "vue-router";
import Home from "@/views/Home.vue";
2021-09-08 08:58:58 +08:00
const routes = [
{
2021-11-15 03:07:00 +08:00
path: "/",
name: "Home",
component: Home,
2021-09-08 08:58:58 +08:00
},
{
2021-11-15 03:07:00 +08:00
path: "/about",
name: "About",
2021-09-08 08:58:58 +08:00
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: function () {
2021-11-15 03:07:00 +08:00
return import(/* webpackChunkName: "about" */ "../views/About.vue");
},
},
];
2021-09-08 08:58:58 +08:00
const router = createRouter({
history: createWebHashHistory(),
2021-11-15 03:07:00 +08:00
routes,
});
2021-09-08 08:58:58 +08:00
2021-11-15 03:07:00 +08:00
export default router;