如何在react-antd中弹出层form内容传递给父组件-创新互联
                                            如何在react-antd中弹出层form内容传递给父组件?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

子组件:
// jshint esversion:6
import React, { Component } from 'react';
import { Form, Input} from 'antd';
const FormItem = Form.Item;
class Forms extends Component{
  getItemsValue = ()=>{  //3、自定义方法,用来传递数据(需要在父组件中调用获取数据)
    const values= this.props.form.getFieldsValue();    //4、getFieldsValue:获取一组输入控件的值,如不传入参数,则获取全部组件的值
    return values;
  }
  render(){
    const { form } = this.props;
    const { getFieldDecorator } = form;  //1、将getFieldDecorator 解构出来,用于和表单进行双向绑定
    return(
      
    )
  }
}
export default Form.create()(Forms); //创建form实例                                                网站标题:如何在react-antd中弹出层form内容传递给父组件-创新互联
文章地址:http://www.cqwzjz.cn/article/docics.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 