import React, { CSSProperties, ReactNode } from "react"; import './Table.scss'; export interface MtTableColumnsType { /** 列数据在数据项中对应的路径 */ dataIndex?: string; /** 列头显示文字 */ title?: ReactNode | (() => ReactNode); /** react 需要的 key,如果已经设置了唯一的 dataIndex,可以忽略这个属性 */ key?: string; /** 单元格align: center, left, right */ align?: string; /** title cell和content cell共有class */ commonCellClass?: string; /** title cell class */ titleCellClass?: string; /** content cell class */ contentCellClass?: string; /** title列自定义样式 */ titleCellStyle?: CSSProperties; /** content列自定义样式 */ contentCellStyle?: CSSProperties; /** 生成复杂数据的渲染函数 参数分别为当前行的值,当前行数据,行索引*/ render?: (text: any, record: Record, index: number) => ReactNode; } export interface MtTableItemType { [key: string]: any; } export interface MtTableProps { children?: ReactNode; /** table添加唯一的 key值 */ tableLabel?: string; /** 是否显示title */ showTitle?: boolean; /** title行自定义样式 */ titleRowStyle?: CSSProperties; /** 自定义title行class */ titleRowClass?: string; /** table数据数组 */ tableList?: MtTableItemType[]; /** 表格列的配置描述 */ columns?: MtTableColumnsType[]; /** 自定义table style */ style?: React.CSSProperties; /** 自定义table class */ customClass?: string; /** 自定义内容行class */ contentRowClass?: string | ((row: MtTableItemType, rowIndex: number) => string); /** 斑马纹表格, 值斑马纹表格颜色 */ stripe?: string; /** 斑马纹类型 odd 奇数, even:偶数 */ stripeType?: string; /** 是否添加table border 颜色值 */ border?: string; /** 是否添加row border 颜色值 */ rowBorder?: string; /** 是否添加column border 颜色值 */ columnBorder?: string; } declare const MtTable: React.FC; export default MtTable;