iView中DatePicker的表单验证问题
1. type="datetime"的验证方式:
<DatePicker v-model="form.chooseDate" placeholder="选择日期" type="datetime" format="yyyy-MM-dd"/>
chooseDate: [{required: true, message: '日期不能为空!', trigger: 'blur', pattern: /.+/}],
后面添加 pattern: /.+/可验证;
2. type="daterange"的验证方式:
modifyTimes: [{
type: 'array',
required: true,
fields: {
0: {type: 'date', required: true, message: '请选择起止日期'},
1: {type: 'date', required: true, message: '请选择起止日期'}
}
}],