import VueI18n from 'vue-i18n'
import Vue from 'vue'
Vue.use(VueI18n)
const messages = {
en: require('../common/lang/en'),
}
const i18n = new VueI18n({
locale: 'en',
messages
})
export default {
data() {
return {
hello: this.$t('hello'),
}
},
i18n,
}
weex中使用vue-i18n进行多语言功能开发代码,测试时在网页上能正常显示,但是集成在android端时报以下错误,
reportJSException >>>> instanceId:28, exception function:createInstance, exception:Exception: TypeError: this.$t is not a function. (In 'this.$t('hello')', 'this.$t' is undefined)
谁知道怎么解决吗?
对的 我也遇到这个问题了 不知道如何解决