antd proTable 默认展开所有层
expandable={{ defaultExpandAllRows: true }}
import React from 'react'; import { ProTable } from '@ant-design/pro-table'; const columns = [ { title: 'Name', dataIndex: 'name', key: 'name', }, { title: 'Age', dataIndex: 'age', key: 'age', }, ]; const data = [ { key: '1', name: 'John Brown', age: 32, children: [ { key: '11', name: 'Child 1', age: 12, }, { key: '12', name: 'Child 2', age: 14, }, ], }, { key: '2', name: 'Jim Green', age: 42, children: [ { key: '21', name: 'Child 3', age: 22, }, { key: '22', name: 'Child 4', age: 24, }, ], }, ]; export default () => ( <ProTable columns={columns} dataSource={data} rowKey="key" expandable={{ defaultExpandAllRows: true }} /> );
标签:name,age,Child,默认,key,proTable,antd From: https://www.cnblogs.com/wwssgg/p/18036223