鍍金池/ 問答/C  HTML/ 關(guān)于Table默認(rèn)勾選框問題 antd

關(guān)于Table默認(rèn)勾選框問題 antd

項(xiàng)目模塊用antd的Table做了個(gè)表格,現(xiàn)在遇到個(gè)問題,發(fā)現(xiàn)Table API里面沒有默認(rèn)勾選的方法,找了半天沒找到,有做過類似的麻煩解答下哈,謝謝

下面是Table demo

const { Table } = antd;
const columns = [{
  title: 'Name',
  dataIndex: 'name',
  render: text => <a href="#">{text}</a>,
}, {
  title: 'Age',
  dataIndex: 'age',
}, {
  title: 'Address',
  dataIndex: 'address',
}];
const data = [{
  key: '1',
  name: 'John Brown',
  age: 32,
  address: 'New York No. 1 Lake Park',
}, {
  key: '2',
  name: 'Jim Green',
  age: 42,
  address: 'London No. 1 Lake Park',
}, {
  key: '3',
  name: 'Joe Black',
  age: 32,
  address: 'Sidney No. 1 Lake Park',
}, {
  key: '4',
  name: 'Disabled User',
  age: 99,
  address: 'Sidney No. 1 Lake Park',
}];
const rowSelection = {
  onChange: (selectedRowKeys, selectedRows) => {
    console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
  }
};

ReactDOM.render(
  <Table scroll={{ x: true, y: 200 }} pagination={false} rowSelection={rowSelection} columns={columns} dataSource={data} />
, mountNode);

圖片描述

圖片描述

回答
編輯回答
扯機(jī)薄

clipboard.png
好好看文檔不好么

2018年8月6日 10:16
編輯回答
澐染

clipboard.png

好像也不行

2017年9月26日 09:55