import { Accessor, For, Match, Show, Switch } from "solid-js" import { Cell } from "./Cell"; import { useTableContext } from "."; import { TableStore, ColumnProps } from '.'; type BodyProps = { data: TableStore, } type RowProps = { store: TableStore, data: any, index: number } export function Row (props: RowProps) { const ctx: any = useTableContext(); const onRowClick = () => { if (props.data._type === 'expandChildren') { return; } // 设置了highlight属性才能进行高亮 if (ctx && ctx.highlight) { ctx.onSelectRow(props.data); } } const classList = () => ({ 'cm-table-row': true, 'cm-table-row-selected': props.data._highlight }) const rowStyle = () => ({ display: props.data._show ? '' : 'none' }) return {/* expand展开的内容 */} {(column: ColumnProps, columnIndex: Accessor) => { let [rowSpan, colSpan] = [1, 1]; if (ctx && ctx.spanMethod) { const ret = ctx.spanMethod(props.data, column, props.index, columnIndex()); if (ret) { [rowSpan, colSpan] = ret; } } return }} } function EmprtyRow (props: any) { return
暂无数据
} export function Body (props: BodyProps) { return {(rowData: any, index: Function) => { return }} }