Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我将 vee-validate 文档中的复制/粘贴到此代码框中,但没有收到验证消息 - 只是控制台上出现以下错误:
[vue-i18n] Cannot translate the value of keypath 'validations.messages._default'. Use the value of keypath as default.
它是 vue-validate 、 vue-i18n 、 vuejs 中的错误吗?还是应该以某种方式对其进行配置?
你忘了初始化 i18n
后
const i18n = new VueI18n();
添加这一行
i18n.locale = "en";
这一行告诉 i18n 它应该寻找什么语言,并将你所有的翻译(你可以在一个 json 文件中)与给定语言的 veevalidator 翻译合并