具有vee-validate和vue-bootstrap的自定义验证器

问题描述

我不确定在哪里问有关vee-validate的问题。除了内置的验证器之外,我还希望创建自己的自定义验证器。我正在使用vue.js和vue-bootstrap例如:

          <b-form-select
            name="input-my-selection"
            v-model="mySelection"
            aria-describedby="input-my-selection-Feedback"
            :options="mySelectionoptions"
            v-validate="myValidator"
          />
<script>
export default {
  data() {
    return {
      mySelection: null,mySelectionoptions: ['red','green','blue'],myValidator: {
      required: true,validate(value) { 
          // additional custom validation logic goes here
          return true;
        }
  }
}

</script>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)