--- order: 4 title: 固定按钮组-底部固定 --- 用在表格行数很多时(一般多于 20 行),又想对表格数据进行频繁的操作时,尤其适用在无限加载的表格中。 ```jsx import { Table, Dropdown, Button, Menu, Icon } from 'antd'; const data = []; for (let i = 0; i < 100; i++) { data.push({ key: i, appName: `我是标题${i}`, status: '已上线', createTime: '2014-12-24 23:12:00' }); } const columns = [{ title: '应用名称', dataIndex: 'appName', key: 'appName', render: (text) => {text} }, { title: '状态', dataIndex: 'status', key: 'status', render: () => 已上线 }, { title: '创建时间', dataIndex: 'createTime', key: 'createTime' }, { title: '操作', key: 'operation', render() { return ( 操作1 更多 ); } }]; const rowSelection = { onChange(selectedRowKeys, selectedRows) { console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); }, onSelect(record, selected, selectedRows) { console.log(record, selected, selectedRows); }, onSelectAll(selected, selectedRows, changeRows) { console.log(selected, selectedRows, changeRows); } }; const menu = ( 操作1 操作2 操作3 ); class FixedButtonGroupBottom extends React.Component { render() { return (
); } } ReactDOM.render(, mountNode); ``` ```css .c-icon-status:before { content: ''; display: inline-block; height: 6px; width: 6px; background-color: #87D068; vertical-align: middle; margin-right: 4px; border-radius: 3px; } .fixed-button-group-demo-b .ant-btn { margin-right: 8px; margin-top: 12px; } .fixed-button-group-demo-b .fbg-table { height: 410px; overflow: auto; } .fixed-button-group-demo-b .fbg-shadow { position: relative; z-index: 10; text-align: right; border-top: 1px solid #e9e9e9; box-shadow: 0px -4px 4px -2px rgba(64, 64, 64, 0.2); } ```