fix(menu): top menu and breadcrumb show wrong (#3703)

This commit is contained in:
zhang 2024-03-29 09:07:55 +08:00 committed by GitHub
parent ea863f2d2d
commit 573fd53b4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
const { t } = useI18n(); const { t } = useI18n();
const { prefixCls } = useDesign('basic-menu-item-content'); const { prefixCls } = useDesign('basic-menu-item-content');
const getI18nName = computed(() => t(props.item?.name)); const getI18nName = computed(() => t(props.item?.meta?.title || props.item?.name));
const getIcon = computed(() => (props.item?.img ? undefined : props.item?.icon)); const getIcon = computed(() => (props.item?.img ? undefined : props.item?.icon));
const getImg = computed(() => props.item?.img); const getImg = computed(() => props.item?.img);
</script> </script>

View File

@ -4,10 +4,10 @@
<template #itemRender="{ route, routes: routesMatched, paths }"> <template #itemRender="{ route, routes: routesMatched, paths }">
<Icon :icon="getIcon(route)" v-if="getShowBreadCrumbIcon && getIcon(route)" /> <Icon :icon="getIcon(route)" v-if="getShowBreadCrumbIcon && getIcon(route)" />
<span v-if="!hasRedirect(routesMatched, route)"> <span v-if="!hasRedirect(routesMatched, route)">
{{ t(route.name || route.meta.title) }} {{ t(route.meta.title || route.name) }}
</span> </span>
<router-link v-else to="" @click="handleClick(route, paths, $event as Event)"> <router-link v-else to="" @click="handleClick(route, paths, $event as Event)">
{{ t(route.name || route.meta.title) }} {{ t(route.meta.title || route.name) }}
</router-link> </router-link>
</template> </template>
</a-breadcrumb> </a-breadcrumb>