index.tsx 604 Bytes
import { Table, type TableProps } from 'antd';

/**
 * 项目统一表格。
 *
 * rootClassName 统一挂 uj:表头底色、行 hover、分隔线、分页贴底这些规则
 * 都在 @uj/ui 的 styles/ui.css 里以 .uj-table 为作用域,页面不需要自己写。
 * 组件的几何量仍然由 themeConfig 的 Table token 下发。
 */
export function UTable<T>(props: TableProps<T>) {
  const { size = 'middle', rootClassName, ...rest } = props;
  return (
    <Table<T>
      size={size}
      rootClassName={['uj-table', rootClassName].filter(Boolean).join(' ')}
      {...rest}
    />
  );
}