Bootstrap

[element-ui] el-date-picker a-range-picker type=“daterange“ rules 校验

<el-form class="pl13" :rules="rules" ref="ruleForm" :model="searchKey">
  	<el-form-item prop="daterange">
		<el-date-picker
	      v-model="value1"
	      type="daterange"
	      range-separator=""
	      start-placeholder="开始日期"
	      end-placeholder="结束日期">
    	</el-date-picker>
    </el-form-item>
</el-form>
<el-form class="pl13" :rules="rules" ref="ruleForm" :model="searchKey">
  	<el-form-item prop="daterange">
		<a-range-picker v-model="daterange"></a-range-picker>
    </el-form-item>
</el-form>
rules: {
	dateRange: [
          {
            type: 'array',
            required: true,
            message: '请选择日期区间',
            fields: {
              // tpye类型试情况而定,所以如果返回的是date就改成date,如果返回的是string就改成string
              0: { type: 'date', required: true, message: '请选择开始日期' },
              1: { type: 'date', required: true, message: '请选择结束日期' },
            },
          },
        ],
 }
;