原文:const { getFieldDecorator } = this.props.form getFieldDecorator報錯“Cannot read property 'getFieldDecorator' of undefined”

我們會直接 const getFieldDecorator this.props.form 直接使用getFieldDecorator 會報錯 Cannot read property getFieldDecorator of undefined 后來查找看了下原因為 使用getFieldDecorator需要導出form組件 export default Form.create 於是就ojbk了 ...

2020-09-08 15:40 0 1164 推薦指數:

查看詳情

getFieldDecorator用法(一)——登錄表單

之前使用antd的ui表單,卻沒發現這么好用的用法,推薦給大家 使用getFieldDecorator ,因為是antd的form的屬性,所以需要導出form組件,export default Form.create()(FormLogin); 效果: 可通過 ...

Mon Oct 08 22:35:00 CST 2018 0 34985
antDesign表單getFieldDecorator

1)getFieldDecorator是一個方法,這個方法接收兩個參數,第一個是表單的字段對象,第二個是驗證規則。這個方法本身返回一個方法,需要將需要獲取值的標簽包裹進去。 const formItemLayout = { labelCol ...

Tue Nov 17 05:55:00 CST 2020 0 2089
Ant Design Form表單中getFieldDecorator使用異常總結

這里使用了props.form.getFieldDecorator(id,{選擇操作})方法來包裝一個Input輸入框組件,傳入的第一個參數表示這個字段的Id,第二個參數是一個配置對象,這里設置了表單控件的校驗規則rules。 問題:填寫Form表單時會發報 Warning ...

Thu Aug 13 23:10:00 CST 2020 0 2441
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM