Skip to content
This repository was archived by the owner on Apr 17, 2022. It is now read-only.

Commit 1edb3ea

Browse files
committed
fix: Programmatic update of v-model on time-picker not working (#37)
1 parent e92672e commit 1edb3ea

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Vue3DatePicker/Vue3DatePicker.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
});
198198
const slots = useSlots();
199199
const isOpen = ref(false);
200-
const modelValue = toRef(props, 'modelValue');
200+
const modelValueMap = toRef(props, 'modelValue');
201201
const dpMenuRef = ref(null);
202202
const inputRef = ref(null);
203203
@@ -223,9 +223,13 @@
223223
const slotList = mapSlots(slots, 'all');
224224
const inputSlots = mapSlots(slots, 'input');
225225
226-
watch(modelValue, () => {
227-
parseExternalModelValue(modelValue.value);
228-
});
226+
watch(
227+
modelValueMap,
228+
() => {
229+
parseExternalModelValue(modelValueMap.value);
230+
},
231+
{ deep: true },
232+
);
229233
230234
const { openOnTop, menuPosition, setMenuPosition, recalculatePosition } = usePosition(
231235
props.position,

0 commit comments

Comments
 (0)