import defaultSettings from '@/settings'
import i18n from'@/locales'
const title = defaultSettings.title || 'Vue3 Admin Template'
export default function getPageTitle(key) {
const hasKey = i18n.te(`route.${key}`)
if (hasKey) {
const pageName = i18n.t(`route.${key}`)
return `${pageName} - ${title}`
}
return `${title}`
}
遇到如下问题:
vue-router.esm-bundler.js?6c02:3248 TypeError: _locales__WEBPACK_IMPORTED_MODULE_2__.default.te is not a function
at getPageTitle (get-page-title.js?036d:7)
at _callee$ (permission.js?223d:19)
at tryCatch (runtime.js?96cf:63)
at Generator.invoke [as _invoke] (runtime.js?96cf:293)
at Generator.eval [as next] (runtime.js?96cf:118)
at asyncGeneratorStep (asyncToGenerator.js?1da1:3)
at _next (asyncToGenerator.js?1da1:25)
at eval (asyncToGenerator.js?1da1:32)
at new Promise (<anonymous>)
at eval (asyncToGenerator.js?1da1:21)
我有注意到你在permission.ts中定义的有如下代码:
我其实在vue-element-admin中的utils/get-page-title.js的基础上修改
遇到如下问题: