Skip to content

Commit

Permalink
fix(projects): 修复面包屑导航下拉菜单语言显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
cc committed May 25, 2023
1 parent 7b746fa commit ee8fa04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/typings/system.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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的路由 */
Expand Down

0 comments on commit ee8fa04

Please sign in to comment.