pickerOptions 不支持选择大于等于当前日期,不支持选择超过一个月(31天)的日期范围
disabledDate: data => {
if (this.pickerMinDate) {
let dayGap = 31 * 24 * 60 * 60 * 1000
let maxDate = this.pickerMinDate + dayGap
let minDate = this.pickerMinDate - dayGap;
if (maxDate > Date.now() - 24 * 60 * 60 * 1000) {
maxDate = Date.now() - 24 * 60 * 60 * 1000
}
return data.getTime() > maxDate || data.getTime() < minDate
}
return data.getTime() > Date.now() - 24 * 60 * 60 * 1000;
},
onPick: ({ maxDate, minDate }) => {
this.pickerMinDate = minDate.getTime()
if (maxDate) {
this.pickerMinDate = ''
}
}