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

时间:2019-06-26 00:32:29   收藏:0   阅读:5088

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

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

Vue.use(iView) 

替换成

Vue.use(iView, {
  i18n: function(path, options) {
    let value = i18n.t(path, options)
    if (value !== null && value !== undefined) {
      return value
    }
    return ''
  }
})

国际化其他配置项不变

原文:https://www.cnblogs.com/smart-girl/p/11084010.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!