element ui 日期控件 范围时间限制 记录

it2024-10-17  15

<el-date-picker :clearable="false" :picker-options="pickerOptions0" value-format="yyyy-MM-dd" v-model="startTime" type="date" placeholder="选择日期"> </el-date-picker> <el-date-picker :clearable="false" :picker-options="pickerOptions1" value-format="yyyy-MM-dd" v-model="endTime" type="date" placeholder="选择日期"> </el-date-picker>//开始时间小于等于今天可选 pickerOptions0: { disabledDate(time) { return time.getTime() < Date.now() - 8.64e7; } },//结束时间小于等于开始时间可选 - 8.64e7 pickerOptions1: { disabledDate: (time) => { return time.getTime() < Date.now() - 8.64e7 || time.getTime() < new Date(that.value1).getTime()- 8.64e7; } },

转载于:https://www.cnblogs.com/zzh-js/p/9441315.html

最新回复(0)