fix(Calendar): failed to watch defaultDate #7815

This commit is contained in:
chenjiahan 2020-12-28 19:42:58 +08:00
parent b3b03e20be
commit 89ecc5f20e

View File

@ -503,14 +503,13 @@ export default createComponent({
);
watch(() => props.show, init);
watch([() => props.type, () => props.minDate, () => props.maxDate], reset);
watch(
[
() => props.type,
() => props.minDate,
() => props.maxDate,
() => props.defaultDate,
],
reset
() => props.defaultDate,
(value) => {
state.currentDate = value;
scrollIntoView();
}
);
useExpose({ reset });