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