优化Table

master
LiuJiaNan 2025-11-12 15:46:41 +08:00
parent 3ef5cb8e19
commit 05d3bb9e22
2 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,11 @@
import type { ProTableProps } from "@ant-design/pro-table";
import type { TableProps } from "antd";
import type { TableProps as AntdTableProps } from "antd";
import type { FC } from "react";
/**
* TablePro
*/
export type TableProProps<DataSource, U, ValueType> = Omit<TableProps, 'columns'> & ProTableProps<DataSource, U, ValueType> & {
export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, 'columns'> & ProTableProps<DataSource, U, ValueType> & {
/** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */
storeIndex?: string;
/** 是否禁用内容区滚动,默认 false */
@ -21,5 +21,5 @@ export type TableProProps<DataSource, U, ValueType> = Omit<TableProps, 'columns'
/**
*
*/
declare const TablePro: <DataSource, U, ValueType = "text">(props: TableProProps<DataSource, U, ValueType>) => ReturnType<FC>;
export default TablePro;
declare const Table: <DataSource, U, ValueType = "text">(props: TableProps<DataSource, U, ValueType>) => ReturnType<FC>;
export default Table;

View File

@ -2,7 +2,7 @@ import Table from "@cqsjjb/jjb-react-admin-component/Table";
import { getIndexColumn } from "../../utils/index";
import "./index.less";
function TablePro(props) {
function Table(props) {
const {
columns = [],
showIndexColumn = true,
@ -18,4 +18,4 @@ function TablePro(props) {
return <Table rowKey={rowKey} columns={calcColumns()} {...restProps} />;
}
export default TablePro;
export default Table;