2019年12月29日

react子传父

摘要: react子组件向父组件传值 不论是vue还是react都是单项数据流,所以说父组件将数据传到子组件中后,子组件不能直接修改父组件的值,那只能将值传到父组件中进行修改 上代码: 先定义父组件 class Parent extends React.Component { constructor(pro 阅读全文

posted @ 2019-12-29 20:28 KDZ 阅读(318) 评论(0) 推荐(0)

react父传子

摘要: react父子传值: 父子组件传值对于vue或者react中来说 都是比较重要的,话不多说 上代码: 首先定义父组件 父组件 class Parent extends React.Component { constructor(props) { super(props) this.state = { 阅读全文

posted @ 2019-12-29 20:02 KDZ 阅读(160) 评论(0) 推荐(0)

导航