【问题标题】:vee-validate dose not change languagevee-validate 不会更改语言
【发布时间】:2019-02-21 05:37:45
【问题描述】:

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

有人知道如何解决这个问题吗?

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

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

谢谢!

【问题讨论】:

    标签: javascript vue.js vee-validate


    【解决方案1】:

    我终于找到了正确的方法

    import VeeValidate, { Validator } from "vee-validate";
    import he from "vee-validate/dist/locale/he";
    
    Validator.localize({ he: he });
    Vue.use(VeeValidate, { locale: "he" });
    

    【讨论】:

    • 以及如何更改语言环境? this.Validator.localize(i18n.locale);它不工作
    猜你喜欢
    • 1970-01-01
    • 2020-12-13
    • 2018-12-01
    • 2020-07-06
    • 2018-06-09
    • 2019-08-14
    • 1970-01-01
    • 2018-03-01
    • 1970-01-01
    相关资源
    最近更新 更多