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

28 lines
600 B
JavaScript
Raw Normal View History

2021-09-08 08:58:58 +08:00
import { createRouter, createWebHashHistory } from 'vue-router'
2021-11-03 01:53:20 +08:00
import Home from '@/views/Home.vue'
2021-09-08 08:58:58 +08:00
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/about',
name: 'About',
// 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 () {
return import(/* webpackChunkName: "about" */ '../views/About.vue')
}
}
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router