我刚刚用 Vue3 开始了一个新项目并添加了 vue-i18n
版本 9 ( https://vue-i18n.intlify.dev/guide/ )
我已经设置了,但我无法更改语言。它正在执行翻译,因为它正在更改 {{ $t('message.value') }}
到适当的句子。
我无法更改语言,仅适用于语言环境。
我在浏览器控制台中收到此错误消息
You are running the esm-bundler build of vue-i18n. It is recommended to configure your bundler to explicitly replace feature flag globals with boolean literals to get proper tree-shaking in the final bundle.
这是我的配置,但我无法将其更改为西类牙语const i18n = VueI18n.createI18n({
locale: 'en', // set locale
fallbackLocale: 'en', // set fallback locale
messages, // set locale messages
})
如果您能帮助我,向我展示我做错了什么,我将不胜感激。非常感谢
最佳答案
在生产模式下运行您的应用程序时,您不应该看到它。
在开发中运行时,它已在版本 v2.0.1 中得到更正。
关于vue.js - Vue3 - i18n - 您正在运行 vue-i18n 的 esm-bundler 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66421384/