chore: add 3rd layer menu demo (#165)

* chore: add 3rd layer menu demo

* chore: fix typescript version
This commit is contained in:
yuyang 2022-06-08 17:05:39 +08:00 committed by GitHub
parent bc373cc7dc
commit 2f8dd15c85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 2 deletions

View File

@ -59,7 +59,7 @@
"stylelint-config-prettier": "^9.0.3", "stylelint-config-prettier": "^9.0.3",
"stylelint-less": "^1.0.1", "stylelint-less": "^1.0.1",
"stylelint-order": "^4.1.0", "stylelint-order": "^4.1.0",
"typescript": "^4.4.3", "typescript": "~4.4.3",
"vite": "^2.7.1", "vite": "^2.7.1",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-svg-loader": "^3.1.0", "vite-svg-loader": "^3.1.0",

View File

@ -0,0 +1,10 @@
<template>
<div>
<div>三级菜单页面</div>
</div>
</template>
<script>
export default {
name: 'NestMenu',
};
</script>

View File

@ -30,7 +30,7 @@ const defaultRouterList: Array<RouteRecordRaw> = [
export const allRoutes = [...defaultRouterList, ...asyncRouterList]; export const allRoutes = [...defaultRouterList, ...asyncRouterList];
export const getActive = (maxLevel = 2): string => { export const getActive = (maxLevel = 3): string => {
const route = useRoute(); const route = useRoute();
if (!route.path) { if (!route.path) {
return ''; return '';

View File

@ -31,4 +31,26 @@ export default [
}, },
], ],
}, },
// 三级菜单配置
// {
// path: '/menu',
// name: 'menu',
// component: Layout,
// meta: { title: '一级菜单', icon: 'menu-fold' },
// children: [
// {
// path: 'second',
// meta: { title: '二级菜单' },
// component: () => import('@/layouts/blank.vue'),
// children: [
// {
// path: 'third',
// name: 'NestMenu',
// component: () => import('@/pages/nest-menu/index.vue'),
// meta: { title: '三级菜单' },
// },
// ],
// },
// ],
// },
]; ];