<a-range-picker
valueFormat="YYYY-MM-DD"
:disabled-date="disabledDate"
@change="onChangeGetTime"
@calendarChange="panelChange"
/>
通过calendarChange 这个方法获得点击的初始值
panelChange(value, mode) {
if (value.length == 1) {
this.query.beginTime = value[0]
}
},
通过初始值是限制范围
disabledDate(current) {
if (this.query.beginTime)
return (
current &&
(current < moment(this.query.beginTime).subtract(60, 'days').endOf('day') ||
current > moment(this.query.beginTime).add(60, 'days').endOf('day'))
)
// subtract 往前60天,add 往后60天
},