请教:路由配置
Closed this issue · 7 comments
ZYong9908 commented
想实现如下效果且不影响路由缓存(指定name),尝试之后没有写出来:
一级路由:
二级路由:
三级路由
二级路由:
三级路由
其中,三级路由不显示,对应的地址分别为:
router
router/page1
router/page1/detail
router/page2
router/page2/detail
对应的面包屑也为:
router
router/page1
router/page1/detail
router/page2
router/page2/detail
hooray commented
现在是怎么写的
ZYong9908 commented
现在是怎么写的
现在就是二级路由,detail隐藏
router
router/page1
router/detail1
router/page2
router/detail2
children: [
{
path: '/myTodo',
component: Layout,
redirect: '/myTodo/todo',
name: 'myTodo',
meta: {
title: '我的待办',
icon: 'ant-design:home',
},
children: [
{
path: 'todo',
name: 'todo',
component: () => import('@/views/todo/todo.vue'),
meta: {
title: '代办',
cache: 'todoDetail1',
},
},
{
path: 'done',
name: 'done',
component: () => import('@/views/todo/done.vue'),
meta: {
title: '完成',
cache: 'todoDetail2',
},
},
{
path: 'detail1',
name: 'todoDetail1',
component: () => import('@/views/todo/detail1.vue'),
meta: {
title: '代办详情',
sidebar: false,
},
},
{
path: 'detail2',
name: 'todoDetail2',
component: () => import('@/views/todo/detail2.vue'),
meta: {
title: '完成详情',
sidebar: false,
},
},
],
},
hooray commented
现在的问题是什么?
ZYong9908 commented
问题是我不会写我想要的形式,所以想请教一下
Hooray Hu ***@***.***> 于 2024年1月22日周一 17:00写道:
… 现在的问题是什么?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKQKC62GIYEUZ44NCUXABATYPYTCBAVCNFSM6AAAAABCEXSMU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTGUZTCOBZHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
hooray commented
ZYong9908 commented
好的感谢,我试一下
Hooray Hu ***@***.***> 于 2024年1月22日周一 17:32写道:
…
https://fantastic-admin.gitee.io/guide/router.html#%E5%B0%8F%E6%8A%80%E5%B7%A7
可以看下这个示例
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKQKC65TZGWSINX7BPNIRITYPYW37AVCNFSM6AAAAABCEXSMU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBTGU4TANZZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
ZYong9908 commented
已成功