computed: {
pickerOptions: function() {
const _this = this
return {
disabledDate(timeSt) {
if (_this.newBuiltForm.after) {
const timeEnd = new Date(_this.newBuiltForm.after)
return timeSt.getTime() >= timeEnd.getTime()
}
}
}
},
pickerOptions1: function() {
const _this = this
return {
disabledDate(time) {
if (_this.newBuiltForm.before) {
const timeEnd = new Date(_this.newBuiltForm.before)
return time.getTime() <= timeEnd.getTime()
}
}
}
}
},
disabledDate 设置禁用状态,参数为当前日期,要求返回 Boolean
:picker-options="pickerOptions1"
picker-options 当前时间日期选择器特有的选项参考下表
shortcuts |
设置快捷选项,需要传入 { text, onClick } 对象用法参考 demo 或下表 |
Object[] |
— |
— |
disabledDate |
设置禁用状态,参数为当前日期,要求返回 Boolean |
Function |
— |
— |
cellClassName |
设置日期的 className |
Function(Date) |
— |
— |
firstDayOfWeek |
周起始日 |
Number |
1 到 7 |
7 |
onPick |
选中日期后会执行的回调,只有当 daterange 或 datetimerange 才生效 |
Function({ maxDate, minDate }) |
— |
— |