优化Table
parent
6342492443
commit
3ef5cb8e19
|
|
@ -11,13 +11,11 @@ function TablePro(props) {
|
|||
rowKey = "id",
|
||||
...restProps
|
||||
} = props;
|
||||
|
||||
const storeIndex = props.storeIndex || `${window.process.env.app.antd["ant-prefix"]}_${Math.random().toString(36).substring(2)}`;
|
||||
function calcColumns() {
|
||||
showIndexColumn && columns.unshift({...getIndexColumn(props.pagination), fixed: indexColumnFixed});
|
||||
return columns.map(item => ({ align: useAlignCenter ? "center" : "left", ...item }));
|
||||
}
|
||||
return <Table rowKey={rowKey} storeIndex={storeIndex} columns={calcColumns()} {...restProps} />;
|
||||
return <Table rowKey={rowKey} columns={calcColumns()} {...restProps} />;
|
||||
}
|
||||
|
||||
export default TablePro;
|
||||
|
|
|
|||
Loading…
Reference in New Issue