vueエラー解決:TypeError:Cannot read property't' of undefined"

517 ワード

フロントエンドエラーは以下の通りです:[Vue warn]:Error in render:“TypeError:Cannot read property'_t'of undefined”
プロジェクトで多言語で構成され、vueとi 18 nの互換性の問題です.解決策は次のとおりです.
    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://github.com/iview/iview/issues/1090