我正在尝试为一个特定的组件扩展已经加载的本地化,我想这样做:
export default {
name: 'General',
components: {
Header,
Content,
NextPageButton
},
i18n: {
messages: {
[this.$i18n.locale]: { message: require('@/locales/' + this.$i18n.locale + '/tso/general.json') }
}
}当然,问题是在i18n选项中没有定义$i18n。如何在此处检索当前区域设置?
发布于 2020-03-03 00:27:29
我使用的Vue实例如下:this.Vue.$i18n.locale
另一种访问方式是this.$root.$i18n.locale
https://stackoverflow.com/questions/60492720
复制相似问题