Skip to content

Commit

Permalink
fix(components/Navigation): 不存在 i18n key 时回滚
Browse files Browse the repository at this point in the history
  • Loading branch information
markthree committed Nov 8, 2023
1 parent 444d887 commit 5879e94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"editor.defaultFormatter": "vscode.json-language-features"
},
"[vue]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { getRoutes } from '@/plugins/router'
import { SwitchIcon } from 'vue-dark-switch'
const { t } = useI18n()
const { te, t } = useI18n()
const routes = getRoutes()
.filter((r) => !r.path.includes('notFound'))
Expand Down Expand Up @@ -32,7 +32,7 @@ const routes = getRoutes()
<ul class="flex items-center gap-2 text-sm font-medium">
<li v-for="r of routes" :key="r.path" class="hidden !block">
<RouterLink class="rounded-lg px-3 py-2" :to="r.path">
{{ t(r.name) }}
{{ te(r.name) ? t(r.name) : r.name }}
</RouterLink>
</li>

Expand Down

0 comments on commit 5879e94

Please sign in to comment.