Browse Source

feat: form add noStyle

pull/5094/head
tangjinzhou 3 years ago
parent
commit
ed3740048a
  1. 2
      components/form/FormItem.tsx

2
components/form/FormItem.tsx

@ -94,6 +94,7 @@ export const formItemProps = {
validateTrigger: { type: [String, Array] as PropType<string | string[]> }, validateTrigger: { type: [String, Array] as PropType<string | string[]> },
messageVariables: { type: Object as PropType<Record<string, string>> }, messageVariables: { type: Object as PropType<Record<string, string>> },
hidden: Boolean, hidden: Boolean,
noStyle: Boolean,
}; };
export type FormItemProps = Partial<ExtractPropTypes<typeof formItemProps>>; export type FormItemProps = Partial<ExtractPropTypes<typeof formItemProps>>;
@ -364,6 +365,7 @@ export default defineComponent({
[`${prefixCls.value}-item-hidden`]: props.hidden, [`${prefixCls.value}-item-hidden`]: props.hidden,
})); }));
return () => { return () => {
if (props.noStyle) return slots.default?.();
const help = props.help ?? (slots.help ? filterEmpty(slots.help()) : null); const help = props.help ?? (slots.help ? filterEmpty(slots.help()) : null);
return ( return (
<Row <Row

Loading…
Cancel
Save