距离上次更新已经过了 914 文中部分内容可能已经过时,如有疑问,请在下方留言。

1 2 3 4 5 6 7 8
| <el-date-picker v-model="date" type="daterange" :pickerOptions="pickerOptions" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" ></el-date-picker>
|
data
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| choiceDate: null, pickerOptions: { onPick: ({ maxDate, minDate }) => { this.choiceDate = minDate.getTime(); if (maxDate) this.choiceDate = ""; }, disabledDate: (time) => { if (this.choiceDate) { const one = 6 * 24 * 3600 * 1000; const minTime = this.choiceDate - one; const maxTime = this.choiceDate + one; return ( time.getTime() < minTime || time.getTime() > maxTime ); } else { } }, },
|
element 中“el-date-picker”限制时间为只能选7天内的日期用法