feat(form): helpMessage Increase function type value (#616)
* feat(form): helpMessage * feat(form): helpMessage
This commit is contained in:
parent
0e440f0793
commit
f455fb97f9
|
|
@ -261,13 +261,14 @@
|
||||||
) : (
|
) : (
|
||||||
label
|
label
|
||||||
);
|
);
|
||||||
if (!helpMessage || (Array.isArray(helpMessage) && helpMessage.length === 0)) {
|
const getHelpMessage = isFunction(helpMessage) ? helpMessage(unref(getValues)) : helpMessage;
|
||||||
|
if (!getHelpMessage || (Array.isArray(getHelpMessage) && getHelpMessage.length === 0)) {
|
||||||
return renderLabel;
|
return renderLabel;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{renderLabel}
|
{renderLabel}
|
||||||
<BasicHelp placement="top" class="mx-1" text={helpMessage} {...helpComponentProps} />
|
<BasicHelp placement="top" class="mx-1" text={getHelpMessage} {...helpComponentProps} />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ export interface FormSchema {
|
||||||
// Auxiliary text
|
// Auxiliary text
|
||||||
subLabel?: string;
|
subLabel?: string;
|
||||||
// Help text on the right side of the text
|
// Help text on the right side of the text
|
||||||
helpMessage?: string | string[];
|
helpMessage?: string | string[] | ((renderCallbackParams: RenderCallbackParams) => string | string[]);
|
||||||
// BaseHelp component props
|
// BaseHelp component props
|
||||||
helpComponentProps?: Partial<HelpComponentProps>;
|
helpComponentProps?: Partial<HelpComponentProps>;
|
||||||
// Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid
|
// Label width, if it is passed, the labelCol and WrapperCol configured by itemProps will be invalid
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue