mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-01-15 16:58:14 +00:00
fix(form): daterange默认值
This commit is contained in:
parent
cfaaaad66e
commit
5f57d620da
@ -43,6 +43,7 @@ interface DefaultItem {
|
||||
type: string;
|
||||
filter: string;
|
||||
multiple: boolean;
|
||||
names?: string[];
|
||||
}
|
||||
|
||||
const isTableSelect = (type?: string | TypeFunction) =>
|
||||
@ -174,7 +175,10 @@ export const createValues = function (
|
||||
return value;
|
||||
};
|
||||
|
||||
const getDefaultValue = function (mForm: FormState | undefined, { defaultValue, type, filter, multiple }: DefaultItem) {
|
||||
const getDefaultValue = function (
|
||||
mForm: FormState | undefined,
|
||||
{ defaultValue, type, filter, multiple, names }: DefaultItem,
|
||||
) {
|
||||
if (typeof defaultValue === 'function') {
|
||||
return defaultValue(mForm);
|
||||
}
|
||||
@ -200,6 +204,10 @@ const getDefaultValue = function (mForm: FormState | undefined, { defaultValue,
|
||||
return [];
|
||||
}
|
||||
|
||||
if (type === 'daterange' && !names) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return '';
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user