From 617e534fda2ae6d468b5e9d3eb43370f8a4b0000 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Wed, 9 Jun 2021 10:31:56 +0800 Subject: [PATCH] fix: form-item class not work --- components/form/FormItem.tsx | 44 +++--------------------------------- v2-doc | 2 +- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 4a43b43e1..4e78d2be5 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -108,7 +108,7 @@ export default defineComponent({ __ANT_NEW_FORM_ITEM: true, props: formItemProps, slots: ['help', 'label', 'extra'], - setup(props, { slots }) { + setup(props, { slots, attrs }) { warning(props.prop === undefined, `\`prop\` is deprecated. Please use \`name\` instead.`); const eventKey = `form-item-${++indexGuid}`; const { prefixCls } = useConfigInject('form', props); @@ -336,9 +336,11 @@ export default defineComponent({ } return ( @@ -370,44 +372,4 @@ export default defineComponent({ ); }; }, - // data() { - // warning(!hasProp(this, 'prop'), `\`prop\` is deprecated. Please use \`name\` instead.`); - // return { - // validateState: this.validateStatus, - // validateMessage: '', - // validateDisabled: false, - // validator: {}, - // helpShow: false, - // errors: [], - // initialValue: undefined, - // }; - // }, - // render() { - // const { autoLink } = getOptionProps(this); - // const children = getSlot(this); - // let firstChildren = children[0]; - // if (this.fieldName && autoLink && isValidElement(firstChildren)) { - // const originalEvents = getEvents(firstChildren); - // const originalBlur = originalEvents.onBlur; - // const originalChange = originalEvents.onChange; - // firstChildren = cloneElement(firstChildren, { - // ...(this.fieldId ? { id: this.fieldId } : undefined), - // onBlur: (...args: any[]) => { - // originalBlur && originalBlur(...args); - // this.onFieldBlur(); - // }, - // onChange: (...args: any[]) => { - // if (Array.isArray(originalChange)) { - // for (let i = 0, l = originalChange.length; i < l; i++) { - // originalChange[i](...args); - // } - // } else if (originalChange) { - // originalChange(...args); - // } - // this.onFieldChange(); - // }, - // }); - // } - // return this.renderFormItem([firstChildren, children.slice(1)]); - // }, }); diff --git a/v2-doc b/v2-doc index 0f6d531d0..6819090fb 160000 --- a/v2-doc +++ b/v2-doc @@ -1 +1 @@ -Subproject commit 0f6d531d088d5283250c8cec1c7e8be0e0d36a36 +Subproject commit 6819090fbcc94b248bc761d5f26162f29c04b2ef