iview 表单验证下拉框不通过问题

6 篇文章 1 订阅

输入框验证

<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' }]
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值