This commit is contained in:
parent
ff2b12b409
commit
7279c0a7b5
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
- 修复 `TableAction`图标问题
|
||||
- 修复菜单折叠按钮丢失问题
|
||||
- 修复菜单相关问题
|
||||
|
||||
## 2.0.0-rc.16 (2020-01-12)
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
const { prefixCls } = useDesign('simple-menu');
|
||||
|
||||
const getShowMenu = computed(() => {
|
||||
return !props.item.meta?.hideMenu;
|
||||
return !props.item?.hideMenu;
|
||||
});
|
||||
|
||||
const getIcon = computed(() => props.item?.icon);
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@ export function transformMenuModule(menuModule: MenuModule): Menu {
|
|||
export function transformRouteToMenu(routeModList: AppRouteModule[]) {
|
||||
const cloneRouteModList = cloneDeep(routeModList);
|
||||
const routeList: AppRouteRecordRaw[] = [];
|
||||
|
||||
// cloneRouteModList = filter(cloneRouteModList, (node) => {
|
||||
// if (Reflect.has(node?.meta ?? {}, 'hideMenu')) {
|
||||
// return !node?.meta.hideMenu;
|
||||
// }
|
||||
// return true;
|
||||
// });
|
||||
cloneRouteModList.forEach((item) => {
|
||||
if (item.meta?.single) {
|
||||
const realItem = item?.children?.[0];
|
||||
|
|
@ -55,13 +62,14 @@ export function transformRouteToMenu(routeModList: AppRouteModule[]) {
|
|||
});
|
||||
return treeMap(routeList, {
|
||||
conversion: (node: AppRouteRecordRaw) => {
|
||||
const { meta: { title, icon } = {} } = node;
|
||||
const { meta: { title, icon, hideMenu = false } = {} } = node;
|
||||
|
||||
!isUrl(node.path) && joinParentPath(routeList, node);
|
||||
return {
|
||||
name: title,
|
||||
icon,
|
||||
path: node.path,
|
||||
hideMenu,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ export interface Menu {
|
|||
meta?: Partial<RouteMeta>;
|
||||
|
||||
tag?: MenuTag;
|
||||
|
||||
hideMenu?: boolean;
|
||||
}
|
||||
|
||||
export interface MenuModule {
|
||||
|
|
|
|||
Loading…
Reference in New Issue