zoukankan      html  css  js  c++  java
  • react with table

    表格相关

    <Table dataSource={data} className="mt1" columns={columns} pagination={pagination}  rowKey={record => record.city_id}/>
    const columns = [{
          title: '学校名称',
          dataIndex: 'school_name',
          key: 'school_name',
          render:(text,record)=>{
            if(text!=null){
              return (<span title={text}>{text.length>15?text.substring(0,15)+'...':text}</span>)
            }
          }
        }]
    var page = {
          onChange: (index) => {
            var params={
              pageIndex: index,
              pageSize: 10,
              filter: {
                city_code: this.state.cityCode,
                school_name: this.state.schoolName
            }};
            this.props.dispatch(actions.getlList(params));
          },
          total: parseInt(count),
          showTotal: (total) => {
            return `共 ${count} 条`
          },
          showQuickJumper: false,
          showSizeChanger: false,
        }

    表格中的key不允许有空格,dataIndex属性为必须,确保datasource为数组形式

  • 相关阅读:
    第三周学习进度总结
    第二周学习进度总结
    动手动脑04
    动手动脑03
    动手动脑02
    课堂实践总结
    课堂实践
    原码,反码和补码学习报告
    开学第一周
    第八周
  • 原文地址:https://www.cnblogs.com/yuanyuan0809/p/6959157.html
Copyright © 2011-2022 走看看