标签:bsp red timestamp ack element err rtt sum 不能
validateDate(rule, value, callback){ if (value) { let timestamp = new Date(value).getTime() let start = new Date(this.shiftStartTime).getTime() let end = new Date(this.shiftEndTime).getTime() if (end < timestamp || timestamp < start) { callback(new Error(`请在值班时间内选择 ${this.shiftStartTime} 至 ${this.shiftEndTime}`)) } else { callback() } } else { callback() } },
<el-form-item label="记录时间" prop="recordDateTime" :rules="[ { required: true, message: ‘记录时间不能为空‘, trigger: ‘blur‘}, { validator: validateDate, trigger: [‘blur‘, ‘change‘] } ]" > <el-date-picker v-model="summaryForm.recordDateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期" ></el-date-picker> </el-form-item>
标签:bsp red timestamp ack element err rtt sum 不能
原文地址:https://www.cnblogs.com/ckmouse/p/11497212.html