Skip to content

Commit

Permalink
fix(menu): fix hideMenu not working close #338
Browse files Browse the repository at this point in the history
  • Loading branch information
anncwb committed Mar 9, 2021
1 parent 53867a8 commit 5b2fbfb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/components/Menu/src/components/BasicSubMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
setup(props) {
const { prefixCls } = useDesign('basic-menu-item');
const getShowMenu = computed(() => {
return !props.item.meta?.hideMenu;
});
const getShowMenu = computed(() => !props.item.meta?.hideMenu);
function menuHasChildren(menuTreeItem: MenuType): boolean {
return (
Reflect.has(menuTreeItem, 'children') &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/SimpleMenu/src/SimpleMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
listenerLastChangeTab((route) => {
if (route.name === REDIRECT_NAME) return;
currentActiveMenu.value = route.meta?.currentActiveMenu;
currentActiveMenu.value = route.meta?.currentActiveMenu as string;
handleMenuChange(route);
if (unref(currentActiveMenu)) {
Expand Down
5 changes: 1 addition & 4 deletions src/components/SimpleMenu/src/SimpleSubMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@
const { t } = useI18n();
const { prefixCls } = useDesign('simple-menu');
const getShowMenu = computed(() => {
return !props.item?.hideMenu;
});
const getShowMenu = computed(() => !props.item?.meta?.hideMenu);
const getIcon = computed(() => props.item?.icon);
const getI18nName = computed(() => t(props.item?.name));
const getShowSubTitle = computed(() => !props.collapse || !props.parent);
Expand Down
2 changes: 1 addition & 1 deletion src/router/routes/modules/demo/feat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const feat: AppRouteModule = {
currentActiveMenu: '/feat/breadcrumb/children',
title: t('routes.demo.feat.breadcrumbChildrenDetail'),
hideTab: true,
hideMenu: true,
// hideMenu: true,
},
},
],
Expand Down

0 comments on commit 5b2fbfb

Please sign in to comment.