2024-03-15 10:59:17 +08:00
|
|
|
import VueRouter from "vue-router";
|
|
|
|
|
|
|
|
|
|
const routes=[
|
|
|
|
|
{
|
|
|
|
|
path:'/login',
|
|
|
|
|
name:'login',
|
|
|
|
|
component: () => import('../components/Login')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path:'/index',
|
|
|
|
|
name:'index',
|
|
|
|
|
component: () => import('../components/Index'),
|
|
|
|
|
children:[
|
|
|
|
|
{
|
|
|
|
|
path:'/home',
|
|
|
|
|
name:'home',
|
|
|
|
|
meta:{
|
|
|
|
|
title:'首页'
|
|
|
|
|
},
|
2024-03-21 09:46:25 +08:00
|
|
|
component: () => import('../components/duochaxun/demo1.vue')
|
2024-03-15 10:59:17 +08:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-21 09:46:25 +08:00
|
|
|
path:'/demo1',
|
|
|
|
|
name:'demo1',
|
2024-03-15 10:59:17 +08:00
|
|
|
meta:{
|
2024-03-21 09:46:25 +08:00
|
|
|
title:'测试1'
|
2024-03-15 10:59:17 +08:00
|
|
|
},
|
2024-03-21 09:46:25 +08:00
|
|
|
component: () => import('@/components/duochaxun/demo1.vue')
|
2024-03-15 10:59:17 +08:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-21 09:46:25 +08:00
|
|
|
path:'/demo2',
|
|
|
|
|
name:'demo2',
|
2024-03-15 10:59:17 +08:00
|
|
|
meta:{
|
2024-03-21 09:46:25 +08:00
|
|
|
title:'测试2'
|
2024-03-15 10:59:17 +08:00
|
|
|
},
|
2024-03-21 09:46:25 +08:00
|
|
|
component: () => import('@/components/duochaxun/demo2.vue')
|
2024-03-15 10:59:17 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const route=new VueRouter({
|
|
|
|
|
mode:'history',
|
|
|
|
|
routes
|
|
|
|
|
})
|
|
|
|
|
const VueRouterPush = VueRouter.prototype.push
|
|
|
|
|
VueRouter.prototype.push = function push (to) {
|
|
|
|
|
return VueRouterPush.call(this, to).catch(err => err)
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-15 15:54:57 +08:00
|
|
|
export default route;
|