hujiabin ee51d91162 1
2023-10-25 16:12:53 +08:00

15 lines
448 B
JavaScript

// translate router.meta.title, be used in breadcrumb sidebar tagsview
export function generateTitle(title) {
// console.log(title)
const hasKey = this.$te('route.' + title)
// const hasKey = this.$te('route.dashboard')
// console.log(hasKey)
if (hasKey) {
// $t :this method from vue-i18n, inject in @/lang/index.js
const translatedTitle = this.$t('route.' + title)
return translatedTitle
}
return title
}