soul2.cn的vue项目
http://soul2.cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.7 KiB
74 lines
1.7 KiB
3 years ago
|
import Vue from "vue";
|
||
|
import VueRouter from "vue-router";
|
||
|
import Layout from "@/layout";
|
||
|
|
||
|
Vue.use(VueRouter)
|
||
|
|
||
|
export const routes = [
|
||
|
{
|
||
|
path: '',
|
||
|
component: Layout,
|
||
|
children: [{
|
||
|
path: '/',
|
||
|
name: 'Home',
|
||
|
component: () => import('@/views/home/index'),
|
||
|
meta: {title: '首页', icon: 'dashboard'}
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
path: '',
|
||
|
component: Layout,
|
||
|
children: [{
|
||
|
path: '/soui',
|
||
|
name: 'SoUI',
|
||
|
component: () => import('@/views/soui/index'),
|
||
|
meta: {title: 'SoUI', icon: 'dashboard'}
|
||
|
}]
|
||
|
},
|
||
|
{
|
||
|
path: '',
|
||
|
component: Layout,
|
||
|
children: [{
|
||
|
path: '/demo',
|
||
|
name: 'SoDemo',
|
||
|
component: () => import('@/views/sodemo/index'),
|
||
|
meta: {title: '灵魂演示', icon: 'dashboard'}
|
||
|
}]
|
||
|
},
|
||
|
// {
|
||
|
// path: '',
|
||
|
// component: Layout,
|
||
|
// meta: {title: '多菜单测试', icon: 'dashboard'},
|
||
|
// children: [{
|
||
|
// path: '/a',
|
||
|
// name: 'a',
|
||
|
// component: () => import('@/views/sodemo/index'),
|
||
|
// meta: {title: '菜单1', icon: 'dashboard'}
|
||
|
// },{
|
||
|
// path: '/b',
|
||
|
// name: 'b',
|
||
|
// component: () => import('@/views/sodemo/index'),
|
||
|
// meta: {title: '菜单2', icon: 'dashboard'}
|
||
|
// }]
|
||
|
// },
|
||
|
]
|
||
|
|
||
|
const createRouter = () => new VueRouter({
|
||
|
base: process.env.VUE_APP_CONTEXT_PATH || '/',
|
||
|
mode: 'history', // require service support
|
||
|
scrollBehavior: () => ({y: 0}),
|
||
|
routes: routes
|
||
|
})
|
||
|
|
||
|
const router = createRouter()
|
||
|
|
||
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
||
|
export function resetRouter() {
|
||
|
const newRouter = createRouter()
|
||
|
router.matcher = newRouter.matcher // reset router
|
||
|
}
|
||
|
|
||
|
export default router
|
||
|
|
||
|
|