vue 在props中设置vue-i18n 多语言

614 阅读1分钟

data 和computed 里直接使用this.$t("message.jwapp.pk")即可

但是在props 里的default 设置默认值时报错。

正确写法是:

default(){

return this.$t("message.jwapp.pk")

}

 

下面这种写法不行:

default: ()=>{

return this.$t('message.jwapp.pk')

}

原文:

vue props vue-i18n 设置了多语言