Blame view

src/utils/get-page-title.js 335 Bytes
80a28914e   吉鹏   init
1
  import defaultSettings from '@/settings'
d7d9c38c2   Adam   auto commit the c...
2
  import i18n from '@/lang'
80a28914e   吉鹏   init
3

d7d9c38c2   Adam   auto commit the c...
4
  const title = defaultSettings.title || 'Vue Element Admin'
80a28914e   吉鹏   init
5

d7d9c38c2   Adam   auto commit the c...
6
7
8
9
10
  export default function getPageTitle(key) {
    const hasKey = i18n.te(`route.${key}`)
    if (hasKey) {
      const pageName = i18n.t(`route.${key}`)
      return `${pageName} - ${title}`
80a28914e   吉鹏   init
11
12
13
    }
    return `${title}`
  }