mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
feat: 当只有一个子菜单时显示父级
This commit is contained in:
parent
e78e1a9cf1
commit
b88f042d20
@ -56,7 +56,8 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
|
|||||||
title: route.name,
|
title: route.name,
|
||||||
icon: route.icon,
|
icon: route.icon,
|
||||||
hidden: !route.visible,
|
hidden: !route.visible,
|
||||||
noCache: !route.keepAlive
|
noCache: !route.keepAlive,
|
||||||
|
alwaysShow: route.children && route.children.length == 1 ? true : false
|
||||||
}
|
}
|
||||||
// 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive
|
// 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive
|
||||||
let data: AppRouteRecordRaw = {
|
let data: AppRouteRecordRaw = {
|
||||||
@ -71,6 +72,7 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
|
|||||||
data.meta = {}
|
data.meta = {}
|
||||||
data.name = toCamelCase(route.path, true) + 'Parent'
|
data.name = toCamelCase(route.path, true) + 'Parent'
|
||||||
data.redirect = ''
|
data.redirect = ''
|
||||||
|
meta.alwaysShow = true
|
||||||
const childrenData: AppRouteRecordRaw = {
|
const childrenData: AppRouteRecordRaw = {
|
||||||
path: '',
|
path: '',
|
||||||
name: toCamelCase(route.path, true),
|
name: toCamelCase(route.path, true),
|
||||||
|
Loading…
Reference in New Issue
Block a user