fix(menu): fix hideMenu not working close #338

This commit is contained in:
Vben 2021-03-09 23:39:21 +08:00
parent 53867a8461
commit 5b2fbfb6ce
4 changed files with 4 additions and 9 deletions

View File

@ -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') &&

View File

@ -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)) {

View File

@ -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);

View File

@ -92,7 +92,7 @@ const feat: AppRouteModule = {
currentActiveMenu: '/feat/breadcrumb/children',
title: t('routes.demo.feat.breadcrumbChildrenDetail'),
hideTab: true,
hideMenu: true,
// hideMenu: true,
},
},
],