提交 7279c0a7 编写于 作者: V vben

refactor(menu): added 'SimpleMenu' component. Solve the menu stuck problem #199 #190 #191

上级 ff2b12b4
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册