react antd 禁用整个表单
2020-06-23 本文已影响0人
沉默紀哖呮肯伱酔
在render函数中添加如下代码
// 禁用整个表单
if (activeData.isActive === 2) {
getFieldDecorator = (...rest) => {
return element => {
let NewElement = React.cloneElement(element, {
disabled: true
});
return this.props.form.getFieldDecorator(...rest)(NewElement);
};
};
}