前端報錯如下:
[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 ''
}
})
國際化其他配置項不變