Comments (9)
from v3-admin.
默认情况下,如果 children 下只有一个子路由,那么就不会显示父路由。如果这种情况下要显示父路由,那么要在父路由设置 alwaysShow: true
from v3-admin.
大佬好,我是想把 '/'根路径的父路由隐藏,只显示里面的子路由(数量大于1).
就如图上的,不显示'测试',只显示首页等等...如图,想要这样的效果.⬇
目前只能每次都要把单独一个路由放到Layout的children里面才能实现这样的效果.
from v3-admin.
那是肯定。但是你为什么要把这些看着像同级的路由,放到根路由的 children 里呢,感觉不必这么做
from v3-admin.
因为我想要打开新标签的时候左侧菜单栏一直存在,
不然的话打开一个路由就变成这样了
from v3-admin.
你并没有找到正确是使用方法...
你像这样新增路由,不就可以解决你的问题了吗?
{
path: '/tag',
component: Layout,
redirect: '/tag/index',
children: [
{
path: 'index',
component: () => import(/* webpackChunkName: "tag" */ '@/views/tag/index.vue'),
name: 'Tag',
meta: {
title: 'tag',
icon: 'tag'
}
}
]
},
from v3-admin.
并不是像你这样全部都添加到根路由的 children。children 明显是子路由的意思,不是用来存放同级路由的
from v3-admin.
你并没有找到正确是使用方法...
你像这样新增路由,不就可以解决你的问题了吗?
{ path: '/tag', component: Layout, redirect: '/tag/index', children: [ { path: 'index', component: () => import(/* webpackChunkName: "tag" */ '@/views/tag/index.vue'), name: 'Tag', meta: { title: 'tag', icon: 'tag' } } ] },
但是这样每次都要新增路由,然后再添加到children里面.
我想直接放到根路由里省事了.
from v3-admin.
好吧,那就只能根据自己需求去修改源码逻辑了
from v3-admin.
Related Issues (10)
- login fail HOT 2
- The 'vite' version is recommended !
- 接口不能访问?不能登录?
- Error after npm run dev HOT 1
- Error during login HOT 3
- English version? HOT 2
- tag 标签切换页面的时候没有缓存 HOT 1
- 第二次请求/users/info接口会报跨域错误 HOT 3
- 脚手架不是vite吗? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v3-admin.