Skip to content
Snippets Groups Projects
Commit 24721077 authored by Pan's avatar Pan
Browse files

perf[i18n]: refine generateTitle function

parent d18902df
Branches
No related tags found
No related merge requests found
// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
return this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
const hasKey = this.$te('route.' + title)
const translatedTitle = this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
if (hasKey) {
return translatedTitle
}
return title
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment