React
H___want
积少成多
展开
-
antd的多个table渲染带复选框
{ <Col>{ this.state.tableData.map((Item,index) =>{ <Table columns=this.columns dataSource={item.tableData} rowKey={(record) => record.id} rowSelection={rowSelection(index)}/ expandedRowKeys={expandedRowKeys}>原创 2020-10-19 11:06:04 · 1655 阅读 · 0 评论 -
关于React引入组件报错
错误信息 Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might hav原创 2020-10-14 16:30:35 · 2719 阅读 · 0 评论 -
React子向父传值
父组件 import React, {Component} from 'react' import Child from './Child' export default class Parent extends Component { constructor(props) { super(props) this.state = { name: ''" } } getChildName = (r原创 2020-10-13 22:34:59 · 110 阅读 · 0 评论 -
React父组件向子组件传值
发发发原创 2020-10-13 22:23:31 · 278 阅读 · 0 评论 -
React页面变化页面数据清空问题
采用 sessionStorage.setItem('paramsId,‘123’) 存储数据 componentDidMount () { sesstionStorage.getItem('paramsId') }localStorage 和sessionStorage的主要区别在于 sessionStorage 在关闭页面后即被清空,而 localStorage 则会一直保存...原创 2020-09-19 00:53:41 · 2283 阅读 · 0 评论 -
React监听路由参数
原声 window.addEventListener('hashChange', () => { // 路由变化 }) componentWillUpdare(nextProps) { if(this.props.location !== nextProps.location) { // 路由变化 } }componentDidMount () { this.props.history.listern(() => { // 路由变化 ..原创 2020-09-19 00:31:11 · 584 阅读 · 0 评论