refactor: adjust routes

This commit is contained in:
张传龙 2022-08-08 15:36:43 +08:00
parent ef3aaa5be5
commit 0bb2a904e7
7 changed files with 19 additions and 16 deletions

View File

@ -1,6 +1,10 @@
<template>
<n-breadcrumb>
<n-breadcrumb-item v-for="item in route.matched" :key="item.path" @click="handleBreadClick(item.path)">
<n-breadcrumb-item
v-for="item in route.matched.filter((item) => !!item.meta?.title)"
:key="item.path"
@click="handleBreadClick(item.path)"
>
<component :is="renderIcon(item.meta?.icon, { size: 16 })" v-if="item.meta?.icon" />
{{ item.meta.title }}
</n-breadcrumb-item>

View File

@ -9,7 +9,7 @@ export const basicRoutes = [
},
{
name: 'LOGIN',
name: 'Login',
path: '/login',
component: () => import('@/views/login/index.vue'),
isHidden: true,
@ -25,7 +25,7 @@ export const basicRoutes = [
meta: {
title: '外部链接',
icon: 'mdi:link-variant',
index: 1,
index: 2,
},
children: [
{

View File

@ -8,7 +8,7 @@ export default {
meta: {
title: '错误页',
icon: 'mdi:alert-circle-outline',
index: 4,
index: 99,
},
children: [
{

View File

@ -10,6 +10,7 @@ export default {
icon: 'mdi:menu',
role: ['admin'],
requireAuth: true,
index: 3,
},
children: [
{

View File

@ -8,12 +8,13 @@ export default {
meta: {
title: '基础功能测试',
icon: 'mdi:menu',
index: 1,
},
children: [
{
name: 'Unocss',
path: 'unocss',
component: () => import('@/views/test-page/unocss/index.vue'),
component: () => import('./unocss/index.vue'),
meta: {
title: '测试unocss',
},
@ -21,7 +22,7 @@ export default {
{
name: 'Message',
path: 'message',
component: () => import('@/views/test-page/message/index.vue'),
component: () => import('./message/index.vue'),
meta: {
title: '测试Message',
},
@ -29,7 +30,7 @@ export default {
{
name: 'Dialog',
path: 'dialog',
component: () => import('@/views/test-page/dialog/index.vue'),
component: () => import('./dialog/index.vue'),
meta: {
title: '测试Dialog',
},
@ -37,7 +38,7 @@ export default {
{
name: 'TestKeepAlive',
path: 'keep-alive',
component: () => import('@/views/test-page/keep-alive/index.vue'),
component: () => import('./keep-alive/index.vue'),
meta: {
title: '测试Keep-Alive',
keepAlive: true,

View File

@ -4,19 +4,16 @@ export default {
name: 'Dashboard',
path: '/',
component: Layout,
redirect: '/home',
meta: {
title: 'Dashboard',
icon: 'mdi:chart-bar',
},
redirect: '/workbench',
children: [
{
name: 'Home',
path: 'home',
name: 'Workbench',
path: 'workbench',
component: () => import('./index.vue'),
meta: {
title: '首页',
title: '工作台',
icon: 'mdi:home',
index: 0,
},
},
],