2020-03-29 18:41:55 +08:00

38 lines
690 B
JavaScript

import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/clear',
name: 'Clear',
component: () => import(/* webpackChunkName: "clear" */ '../views/Clear/Clear.vue'),
meta: {
keepAlive: true
},
},
{
path: '/comment',
name: 'Comment',
component: () => import(/* webpackChunkName: "comment" */ '../views/Comment/Comment.vue'),
meta: {
keepAlive: true
},
},
{
path: '*', // 页面不存在的情况下会跳到home
redirect: '/clear',
name: 'notFound',
hidden: true
}
]
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
routes,
})
export default router