vee-validate不得更改语言

时间:2019-02-21 05:37:45

标签: javascript vue.js vee-validate

我正在尝试更改vee-validate中的错误消息,但它不起作用...

有人知道该如何解决吗?

import VeeValidate from "vee-validate";
import hebrew from "vee-validate/dist/locale/he";

Vue.use(VeeValidate, {
  locale: "he",
  dictionary: {
    he: { messages: hebrew }
  }
});

谢谢!

1 个答案:

答案 0 :(得分:2)

我终于找到了正确的方法

import VeeValidate, { Validator } from "vee-validate";
import he from "vee-validate/dist/locale/he";

Validator.localize({ he: he });
Vue.use(VeeValidate, { locale: "he" });