88 lines
1.9 KiB
JavaScript
88 lines
1.9 KiB
JavaScript
import { createRouter, createWebHashHistory } from 'vue-router'
|
|
const layoutIndex = () => import('../layout/layoutIndex.vue')
|
|
|
|
const zdLogin = () => import('../views/login/zdLogin.vue')
|
|
const zdUsers = () => import('../views/users/zdUsers.vue')
|
|
const zdCategories = () => import('../views/categories/zdCategories.vue')
|
|
const zdGoods = () => import('../views/goods/zdGoods.vue')
|
|
const zdOrders = () => import('../views/orders/zdOrders.vue')
|
|
const zdParams = () => import('../views/params/zdParams.vue')
|
|
const zdReports = () => import('../views/reports/zdReports.vue')
|
|
const zdRights = () => import('../views/rights/zdRights.vue')
|
|
const zdRoles = () => import('../views/roles/zdRoles.vue')
|
|
|
|
const routes = [
|
|
// 登录路由
|
|
{
|
|
path: '/login',
|
|
component: zdLogin,
|
|
meta: {
|
|
title: '登录界面'
|
|
}
|
|
},
|
|
// 将 / 重定向到 /login
|
|
{
|
|
path: '/',
|
|
redirect: '/login'
|
|
},
|
|
// 菜单界面相关路由
|
|
{
|
|
path: '/menu',
|
|
component: layoutIndex,
|
|
meta: {
|
|
title: '菜单界面'
|
|
},
|
|
// 重定向,默认到 菜单界面的 user 分支
|
|
redirect: '/menu/users',
|
|
children: [
|
|
{
|
|
path: 'users',
|
|
name: 'users',
|
|
component: zdUsers
|
|
},
|
|
{
|
|
path: 'categories',
|
|
name: 'categories',
|
|
component: zdCategories
|
|
},
|
|
{
|
|
path: 'goods',
|
|
name: 'goods',
|
|
component: zdGoods
|
|
},
|
|
{
|
|
path: 'orders',
|
|
name: 'orders',
|
|
component: zdOrders
|
|
},
|
|
{
|
|
path: 'params',
|
|
name: 'params',
|
|
component: zdParams
|
|
},
|
|
{
|
|
path: 'reports',
|
|
name: 'reports',
|
|
component: zdReports
|
|
},
|
|
{
|
|
path: 'rights',
|
|
name: 'rights',
|
|
component: zdRights
|
|
},
|
|
{
|
|
path: 'roles',
|
|
name: 'roles',
|
|
component: zdRoles
|
|
}
|
|
]
|
|
}
|
|
]
|
|
|
|
const router = createRouter({
|
|
history: createWebHashHistory(),
|
|
routes
|
|
})
|
|
|
|
export default router
|