输入框验证
<FormItem label="跟单人" prop="followUpPerson">
<Input v-model="addCustomerPar.followUpPerson" :disabled='customerDisabled'></Input>
</FormItem>
addCustomerRules: {
followUpPerson: [{ required: true,message: '此项不能为空', trigger: 'change' }],
},
iview进行表单验证select时候验证失败的问题:
用iview自带的表单验证select标签的时候,一直验证不通过,因为iview默认校验数据类型为String,而我的select用的value是number类型的
<FormItem label="跟单人" prop="followUpPerson">
<Select
v-model="addCustomerPar.followUpPerson"
filterable
:disabled='customerDisabled'
>
<Option v-for="(item, index) in queryCurrStaff" :key="index" :value="item.userId">{{item.nickName}}</Option>
</Select>
</FormItem>
addCustomerRules: {
followUpPerson: [{ required: true,message: '此项不能为空', trigger: 'blur', type:'number' }]
}
iview进行表单验证时间日期验证失败的问题:
和下拉框一样,日期的类型是data
addCustomerRules: {
followUpPerson: [{ required: true,message: '此项不能为空', trigger: 'change', type:'data' }]
}