fix(form): placeholder setting in componentProps (#634)

修复为RangePicker组件设置的placeholder属性无效的BUG
This commit is contained in:
Netfan 2021-05-21 09:36:41 +08:00 committed by GitHub
parent bb0d2e1c71
commit 2d3d04f547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,13 +248,11 @@
};
const isCreatePlaceholder = !propsData.disabled && autoSetPlaceHolder;
let placeholder;
// RangePicker place is an array
if (isCreatePlaceholder && component !== 'RangePicker' && component) {
placeholder =
propsData.placeholder =
unref(getComponentsProps)?.placeholder || createPlaceholderMessage(component);
}
propsData.placeholder = placeholder;
propsData.codeField = field;
propsData.formValues = unref(getValues);
@ -289,7 +287,9 @@
) : (
label
);
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
const getHelpMessage = isFunction(helpMessage)
? helpMessage(unref(getValues))
: helpMessage;
if (!getHelpMessage || (Array.isArray(getHelpMessage) && getHelpMessage.length === 0)) {
return renderLabel;
}