From abdeb4cd6d21c2a85316e4957f43ab92f6873d3e Mon Sep 17 00:00:00 2001 From: "damon.chen" Date: Sun, 16 Sep 2018 17:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9getFormItemOptions=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=ADcustomprops=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this.customprops并不存在,而是通过props传入到组件里的,所以应该是用this.props.customprops获取,而不应该是this.customprops --- src/components/Login/LoginItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Login/LoginItem.js b/src/components/Login/LoginItem.js index 1732315f..2c6eae69 100644 --- a/src/components/Login/LoginItem.js +++ b/src/components/Login/LoginItem.js @@ -43,9 +43,9 @@ class WarpFormItem extends Component { } }; - getFormItemOptions = ({ onChange, defaultValue, rules }) => { + getFormItemOptions = ({ onChange, defaultValue, customprops, rules }) => { const options = { - rules: rules || this.customprops.rules, + rules: rules || customprops.rules, }; if (onChange) { options.onChange = onChange; -- GitLab