Blame view

antis-ncc-admin/src/utils/i18n.js 369 Bytes
03207d5d   wwk   1
1
2
3
4
5
6
7
8
9
10
11
12
  // translate router.meta.title, be used in breadcrumb sidebar tagsview
  export function generateTitle(title, fullName) {
    const hasKey = this.$te('route.' + title)
  
    if (hasKey) {
      // $t :this method from vue-i18n, inject in @/lang/index.js
      const translatedTitle = this.$t('route.' + title)
  
      return translatedTitle
    }
    return fullName ? fullName : title
  }