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.show, init);
watch([() => props.type, () => props.minDate, () => props.maxDate], reset);
watch( watch(
[ () => props.defaultDate,
() => props.type, (value) => {
() => props.minDate, state.currentDate = value;
() => props.maxDate, scrollIntoView();
() => props.defaultDate, }
],
reset
); );
useExpose({ reset }); useExpose({ reset });