mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 19:44:50 +08:00
fix(menu): fix hideMenu not working close #338
This commit is contained in:
@@ -36,9 +36,7 @@
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const { prefixCls } = useDesign('basic-menu-item');
|
const { prefixCls } = useDesign('basic-menu-item');
|
||||||
|
|
||||||
const getShowMenu = computed(() => {
|
const getShowMenu = computed(() => !props.item.meta?.hideMenu);
|
||||||
return !props.item.meta?.hideMenu;
|
|
||||||
});
|
|
||||||
function menuHasChildren(menuTreeItem: MenuType): boolean {
|
function menuHasChildren(menuTreeItem: MenuType): boolean {
|
||||||
return (
|
return (
|
||||||
Reflect.has(menuTreeItem, 'children') &&
|
Reflect.has(menuTreeItem, 'children') &&
|
||||||
|
@@ -94,7 +94,7 @@
|
|||||||
listenerLastChangeTab((route) => {
|
listenerLastChangeTab((route) => {
|
||||||
if (route.name === REDIRECT_NAME) return;
|
if (route.name === REDIRECT_NAME) return;
|
||||||
|
|
||||||
currentActiveMenu.value = route.meta?.currentActiveMenu;
|
currentActiveMenu.value = route.meta?.currentActiveMenu as string;
|
||||||
handleMenuChange(route);
|
handleMenuChange(route);
|
||||||
|
|
||||||
if (unref(currentActiveMenu)) {
|
if (unref(currentActiveMenu)) {
|
||||||
|
@@ -75,10 +75,7 @@
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const { prefixCls } = useDesign('simple-menu');
|
const { prefixCls } = useDesign('simple-menu');
|
||||||
|
|
||||||
const getShowMenu = computed(() => {
|
const getShowMenu = computed(() => !props.item?.meta?.hideMenu);
|
||||||
return !props.item?.hideMenu;
|
|
||||||
});
|
|
||||||
|
|
||||||
const getIcon = computed(() => props.item?.icon);
|
const getIcon = computed(() => props.item?.icon);
|
||||||
const getI18nName = computed(() => t(props.item?.name));
|
const getI18nName = computed(() => t(props.item?.name));
|
||||||
const getShowSubTitle = computed(() => !props.collapse || !props.parent);
|
const getShowSubTitle = computed(() => !props.collapse || !props.parent);
|
||||||
|
@@ -92,7 +92,7 @@ const feat: AppRouteModule = {
|
|||||||
currentActiveMenu: '/feat/breadcrumb/children',
|
currentActiveMenu: '/feat/breadcrumb/children',
|
||||||
title: t('routes.demo.feat.breadcrumbChildrenDetail'),
|
title: t('routes.demo.feat.breadcrumbChildrenDetail'),
|
||||||
hideTab: true,
|
hideTab: true,
|
||||||
hideMenu: true,
|
// hideMenu: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user