有没有办法将单水疗道具传递给 vue i18n 实例,将其分配给消息 i18n 道具。
I18n 构造函数:
const i18n = new VueI18n({
locale: process.env.VUE_APP_I18N_LOCALE,
messages: {},
});
Vue单spa实例:
const vueLifecycles = singleSpaVue({
Vue,
appOptions: {
el: '#account',
render() {
return (
<App
eventBus={this.$data.eventBus}
lang={this.$data.lang}
></App>
);
},
i18n,
},
});
信息:我无权访问lang
渲染功能之外。
基本上,我需要 i18n 消息对象中的 lang 道具。我已经尝试返回 lang,但它进入构造函数,不起作用。我还尝试在收到后重新实例化 i18n/消息,但lang
也不起作用。还有其他想法吗?