Commit 24721077 authored by Pan's avatar Pan

perf[i18n]: refine generateTitle function

parent d18902df
// translate router.meta.title, be used in breadcrumb sidebar tagsview // translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) { 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
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment