feat: 单个菜单时替换父菜单处理

This commit is contained in:
张传龙
2022-04-23 22:34:12 +08:00
parent cf1b83d3f1
commit bf2d45416f
5 changed files with 70 additions and 55 deletions

View File

@@ -1,7 +1,16 @@
import Layout from '@/layout/index.vue'
import Home from '@/views/dashboard/index.vue'
import { IconAlert, IconChart, IconGitee, IconGithub, IconHome, IconLink, IconVue } from '@/components/AppIcons'
import {
IconAlert,
IconChart,
IconGitee,
IconGithub,
IconHome,
IconLink,
IconMenu,
IconVue,
} from '@/components/AppIcons'
export const basicRoutes = [
{
@@ -55,6 +64,28 @@ export const basicRoutes = [
],
},
{
name: 'ErrorPage',
path: '/error-page',
component: Layout,
redirect: '/error-page/404',
meta: {
title: '错误页',
icon: IconAlert,
},
children: [
{
name: 'ERROR-404',
path: '404',
component: () => import('@/views/error-page/404.vue'),
meta: {
title: '404',
icon: IconAlert,
},
},
],
},
{
name: 'Test',
path: '/test',
@@ -62,6 +93,7 @@ export const basicRoutes = [
redirect: '/test/unocss',
meta: {
title: '基础功能测试',
icon: IconMenu,
},
children: [
{
@@ -100,27 +132,6 @@ export const basicRoutes = [
],
},
{
name: 'ErrorPage',
path: '/error-page',
component: Layout,
redirect: '/error-page/404',
meta: {
title: '错误页',
icon: IconAlert,
},
children: [
{
name: 'ERROR-404',
path: '404',
component: () => import('@/views/error-page/404.vue'),
meta: {
title: '404',
},
},
],
},
{
name: 'ExternalLink',
path: '/external-link',

View File

@@ -1,4 +1,6 @@
import { IconMenuTable } from '@/components/AppIcons'
import Layout from '@/layout/index.vue'
import { markRaw } from 'vue'
export default [
{
@@ -19,6 +21,7 @@ export default [
meta: {
title: '表格',
role: ['admin'],
icon: markRaw(IconMenuTable),
},
children: [
{