You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
331 B

5 years ago
  1. // translate router.meta.title, be used in breadcrumb sidebar tagsview
  2. export function generateTitle(title) {
  3. const hasKey = this.$te('route.' + title)
  4. const translatedTitle = this.$t('route.' + title) // $t :this method from vue-i18n, inject in @/lang/index.js
  5. if (hasKey) {
  6. return translatedTitle
  7. }
  8. return title
  9. }