在这个表单render下添加
let { getFieldDecorator } = this.props.form; if (this.props.disabled) {
getFieldDecorator = (...rest) => {
return element => {
let NewElement = React.cloneElement(element, {
disabled: true
});
return this.props.form.getFieldDecorator(...rest)(NewElement);
};
};
}
然后在点击查看时传入参数
that.setState({ disabled: true
},()=>{
that.loadData();
});
不禁用时就把disadble : false
还没有评论,来说两句吧...