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

断了今生、忘了曾经 提交于 2019-12-11 19:45:11

问题


Hello I did a copy/paste from the vee-validate documentation into this codesandbox and I get no validation message - just the following error on the console:

[vue-i18n] Cannot translate the value of keypath 'validations.messages._default'. Use the value of keypath as default.

Is it a bug within vue-validate , vue-i18n, vuejs ? Or should one configurate it somehow different?


回答1:


you forgot to initialize i18n

After

const i18n = new VueI18n();

add this line

i18n.locale = "en";

this line tells i18n what the language it should look for, and merges all your translations (that you can have in a json file) with the veevalidator translations of the given language



来源:https://stackoverflow.com/questions/55045730/vue-i18n-integration-by-vee-validate-not-working-as-described-in-the-documentati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!