el-date-picker 动态日期范围

Vue2 & element ui

 _maxTime;
                    }
                }
            }
        };
    }
    ……
};

Vue3 & element plus

 {
    if (_minTime.value && _maxTime.value) {
        return time.getTime() < _minTime.value || time.getTime() > _maxTime.value;
    }
};

const eventCalendarChange = (data) => {
    const [ start ] = data;
    if (start) {
        _minTime.value = start.getTime() - timeRange;
        _maxTime.value = start.getTime() + timeRange;
    } else {
        _minTime.value = null;
        _maxTime.value = null;
    }
};

你可能感兴趣的:(el-date-picker 动态日期范围)