Skip to content

Commit

Permalink
fix: datePicker valueFormat log warning, close #5323
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Mar 12, 2022
1 parent ce00829 commit f7e8999
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/calendar/generateCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ function generateCalendar<
? (generateConfig.toDate(props.value, props.valueFormat) as DateType)
: (props.value as DateType);
}
return props.value as DateType;
return null;
});
const defaultValue = computed(() => {
if (props.defaultValue) {
return props.valueFormat
? (generateConfig.toDate(props.defaultValue, props.valueFormat) as DateType)
: (props.defaultValue as DateType);
}
return props.defaultValue as DateType;
return null;
});

// Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
? generateConfig.toDate(props.value as string | DateType, props.valueFormat)
: props.value;
}
return props.value;
return null;
});
const defaultValue = computed(() => {
if (props.defaultValue) {
return props.valueFormat
? generateConfig.toDate(props.defaultValue as string | DateType, props.valueFormat)
: props.defaultValue;
}
return props.defaultValue;
return null;
});
const defaultPickerValue = computed(() => {
if (props.defaultPickerValue) {
Expand All @@ -138,7 +138,7 @@ export default function generateSinglePicker<DateType, ExtraProps = {}>(
)
: props.defaultPickerValue;
}
return props.defaultPickerValue;
return null;
});

return () => {
Expand Down

0 comments on commit f7e8999

Please sign in to comment.