fix(projects): 修复面包屑导航下拉菜单语言显示问题
This commit is contained in:
parent
7b746fa053
commit
ee8fa04814
@ -9,7 +9,7 @@
|
|||||||
v-if="theme.header.crumb.showIcon"
|
v-if="theme.header.crumb.showIcon"
|
||||||
class="inline-block align-text-bottom mr-4px text-16px"
|
class="inline-block align-text-bottom mr-4px text-16px"
|
||||||
/>
|
/>
|
||||||
<span>{{ breadcrumb.i18nTitle ? t(breadcrumb.i18nTitle) : breadcrumb.label }}</span>
|
<span>{{ breadcrumb.label }}</span>
|
||||||
</span>
|
</span>
|
||||||
</n-dropdown>
|
</n-dropdown>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
@ -20,7 +20,7 @@
|
|||||||
:class="{ 'text-#BBBBBB': theme.header.inverted }"
|
:class="{ 'text-#BBBBBB': theme.header.inverted }"
|
||||||
/>
|
/>
|
||||||
<span :class="{ 'text-#BBBBBB': theme.header.inverted }">
|
<span :class="{ 'text-#BBBBBB': theme.header.inverted }">
|
||||||
{{ breadcrumb.i18nTitle ? t(breadcrumb.i18nTitle) : breadcrumb.label }}
|
{{ breadcrumb.label }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</n-breadcrumb-item>
|
</n-breadcrumb-item>
|
||||||
@ -45,7 +45,13 @@ const routeStore = useRouteStore();
|
|||||||
const { routerPush } = useRouterPush();
|
const { routerPush } = useRouterPush();
|
||||||
|
|
||||||
const breadcrumbs = computed(() =>
|
const breadcrumbs = computed(() =>
|
||||||
getBreadcrumbByRouteKey(route.name as string, routeStore.menus as App.GlobalMenuOption[], routePath('root'))
|
getBreadcrumbByRouteKey(route.name as string, routeStore.menus as App.GlobalMenuOption[], routePath('root')).map(
|
||||||
|
item => ({
|
||||||
|
...item,
|
||||||
|
label: item.i18nTitle ? t(item.i18nTitle) : item.label,
|
||||||
|
options: item.options?.map(oItem => ({ ...oItem, label: oItem.i18nTitle ? t(oItem.i18nTitle) : oItem.label }))
|
||||||
|
})
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
function dropdownSelect(key: string) {
|
function dropdownSelect(key: string) {
|
||||||
|
2
src/typings/system.d.ts
vendored
2
src/typings/system.d.ts
vendored
@ -254,7 +254,7 @@ declare namespace App {
|
|||||||
hasChildren: boolean;
|
hasChildren: boolean;
|
||||||
icon?: import('vue').Component;
|
icon?: import('vue').Component;
|
||||||
i18nTitle?: string;
|
i18nTitle?: string;
|
||||||
options?: import('naive-ui/es/dropdown/src/interface').DropdownMixedOption[];
|
options?: (import('naive-ui/es/dropdown/src/interface').DropdownMixedOption & { i18nTitle?: string })[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 多页签Tab的路由 */
|
/** 多页签Tab的路由 */
|
||||||
|
Loading…
Reference in New Issue
Block a user