vue 报错解决:TypeError: Cannot read property '_t' of undefined"

系统管理员 2021-12-03 08:01 544阅读 0赞

前端报错如下:
[Vue warn]: Error in render: “TypeError: Cannot read property ‘_t’ of undefined”

是在项目中用了多语言配置,vue 跟 i18n之间的兼容问题。解决方法如下:

  1. Vue.use(iView)

替换成

  1. Vue.use(iView, {
  2. i18n: function(path, options) {
  3. let value = i18n.t(path, options)
  4. if (value !== null && value !== undefined) {
  5. return value
  6. }
  7. return ''
  8. }
  9. })

国际化其他配置项不变

转载于:https://www.cnblogs.com/smart-girl/p/11084010.html

发表评论

表情:
评论列表 (有 0 条评论,544人围观)

还没有评论,来说两句吧...

相关阅读