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