From e3051e24d0c52ac4e29fbbc7062f97f9ebc5fa0d Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期四, 18 九月 2025 14:19:33 +0800
Subject: [PATCH] fix: bug

---
 packages/components/src/Input/ChooseInputWithDatePicker.vue |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/packages/components/src/Input/ChooseInputWithDatePicker.vue b/packages/components/src/Input/ChooseInputWithDatePicker.vue
index ca4897c..c8dbe1d 100644
--- a/packages/components/src/Input/ChooseInputWithDatePicker.vue
+++ b/packages/components/src/Input/ChooseInputWithDatePicker.vue
@@ -18,16 +18,19 @@
   minDate?: Date;
   maxDate?: Date;
   type?: string;
+  format?: string;
 };
 
-const props = withDefaults(defineProps<Props>(), {});
+const props = withDefaults(defineProps<Props>(), {
+  format: 'YYYY-MM-DD',
+});
 
 const emit = defineEmits<{
   (e: 'update:modelValue', val: string | number): void;
 }>();
 
 function handleOpen() {
-  const _modelValue = [props.modelValue];
+  const _modelValue = dayjs(props.modelValue).toDate();
   Portal.add((key) => {
     return h(
       Portal.Container,
@@ -49,7 +52,8 @@
                   type: props.type,
                   maxDate: props.maxDate,
                   onConfirm: ({ selectedValue }) => {
-                    emit('update:modelValue', dayjs(selectedValue.join('-')).format('YYYY-MM-DD'));
+                    console.log('selectedValue: ', selectedValue);
+                    emit('update:modelValue', dayjs(selectedValue.join('-')).format(props.format));
                     onClose();
                   },
                   minDate: props.minDate,

--
Gitblit v1.9.1