vee-validate 的 Vue-i18n 集成无法按照文档中的描述工作

Vue-i18n Integration by vee-validate not working as described in the documentation

您好,我从 vee-validate documentation into this codesandbox 中执行了 copy/paste,但没有收到任何验证消息 - 控制台上只有以下错误:

[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 翻译合并