import { Module } from '../module' import { TableColumn } from './column' import { TableRow } from './row' import { Table } from './table' interface TableBodyOpts { table: Table list: T[] cols: TableColumn[] } /** * 表格主体. */ export class TableBody extends Module { constructor(opts: TableBodyOpts) { super(document.createElement('tbody')) this.addChild( ...opts.list.map( (data, idx) => new TableRow({ data, cols: opts.cols, rowIdx: idx }) ) ) } }