zhengyiming
4 天以前 898b58d4b2f12413264cce2a194f023e7cd27697
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,7 @@
                  type: props.type,
                  maxDate: props.maxDate,
                  onConfirm: ({ selectedValue }) => {
                    emit('update:modelValue', dayjs(selectedValue.join('-')).format('YYYY-MM-DD'));
                    emit('update:modelValue', dayjs(selectedValue.join('-')).format(props.format));
                    onClose();
                  },
                  minDate: props.minDate,