如何在Vuelidate中保持字段可选? Vuelidate在代码中给出了$v。为了检查表单验证,我们有$invalid prop Now,如何根据复选框保持x字段可选,例如。 [ ] use y field
[ y text field ] (right now optional) 但如果我选中复选框 [x] use y field
[ y text field ] (now its required and it will follow other validations such as sameAs/minLength/max/custom validation PS:它还应该验证自定
我正在尝试将一个插件库导入到我的组件中。
但此导入返回一个错误:Uncaught :意外标识符
如何将其导入我的vue.js组件?
首先,我正在使用webpack,并调用First Vuelidate
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications
我在我的项目中使用。我有一个用和创建的表单来验证字段。在表单的某些地方,用户将能够添加多个地址,因此我在组件的数据中创建了一个名为“addresses”的数组。
addresses: [
{
street: ''
//there will be more itens here in the future
}
]
现在,为了验证字段,我创建了一个,其中我将添加这个字段,但重点是,我不知道如何将字段(在我的数组中)“链接”到验证组。
在Vuelidate文档中,有一个节,但是我没有找到如何在验证组中使用它。