54 lines
1.0 KiB
JavaScript
54 lines
1.0 KiB
JavaScript
import Vue from 'vue'
|
|
import VueRouter from 'vue-router'
|
|
|
|
Vue.use(VueRouter)
|
|
|
|
const routes = [
|
|
{
|
|
path: '/home',
|
|
name: 'Home',
|
|
component: () => import(/* webpackChunkName: "verify" */ '../views/Home/Home.vue'),
|
|
meta: {
|
|
keepAlive: true
|
|
},
|
|
},
|
|
{
|
|
path: '/create',
|
|
name: 'Create',
|
|
component: () => import(/* webpackChunkName: "create" */ '../views/Create/Create.vue'),
|
|
meta: {
|
|
keepAlive: false
|
|
},
|
|
},
|
|
{
|
|
path: '/account',
|
|
name: 'Account',
|
|
component: () => import(/* webpackChunkName: "account" */ '../views/Account/Account.vue'),
|
|
meta: {
|
|
keepAlive: true
|
|
},
|
|
},
|
|
{
|
|
path: '/detail',
|
|
name: 'Detail',
|
|
component: () => import(/* webpackChunkName: "detail" */ '../views/Detail/Detail.vue'),
|
|
meta: {
|
|
keepAlive: false
|
|
},
|
|
},
|
|
{
|
|
path: '*', // 页面不存在的情况下会跳到home
|
|
redirect: '/home',
|
|
name: 'notFound',
|
|
hidden: true
|
|
}
|
|
]
|
|
|
|
const router = new VueRouter({
|
|
mode: 'history',
|
|
base: process.env.BASE_URL,
|
|
routes,
|
|
})
|
|
|
|
export default router
|