From b31015ac3cbe5062873a1502fcc9f8118560af2d Mon Sep 17 00:00:00 2001 From: anlyyao Date: Mon, 26 Jun 2023 16:09:10 +0800 Subject: [PATCH] fix(DateTimePicker): fix modelValue invalid --- src/date-time-picker/date-time-picker.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/date-time-picker/date-time-picker.vue b/src/date-time-picker/date-time-picker.vue index 429592395..51c46fe42 100644 --- a/src/date-time-picker/date-time-picker.vue +++ b/src/date-time-picker/date-time-picker.vue @@ -50,8 +50,13 @@ export default defineComponent({ setup(props: any, context) { const emitEvent = useEmitEvent(props, context.emit); const className = computed(() => [`${name}`]); - const { value, modelValue } = toRefs(props); - const [innerValue, setDateTimePickerValue] = useVModel(value, modelValue, props.defaultValue, props.onChange); + const { value } = toRefs(props); + const [innerValue, setDateTimePickerValue] = useVModel( + value, + ref(props.modelValue), + props.defaultValue, + props.onChange, + ); const title = computed(() => { return props.title || '选择时间'; });