UNPKG

comic-plus

Version:

<p align="center"> <img width="200px" src="./logo.png"/> </p>

48 lines (47 loc) 1.23 kB
import { defineComponent, inject, h } from "vue"; import { TABLE_PROVIDE } from "../type.mjs"; import TableColgroup from "../components/table-colgroup.mjs"; import TableRow from "../components/table-row.mjs"; const TableBody = defineComponent({ name: "TableBody", setup(_, { slots }) { const { renderData } = inject(TABLE_PROVIDE); return () => { var _a; return h( "div", { class: "cu-table__body" }, [ renderData.value.length === 0 ? h( "div", { class: "cu-table__empty" }, [((_a = slots["empty"]) == null ? void 0 : _a.call(slots)) || h("div", { class: "cu-table__empty_default" }, "暂无数据")] ) : null, h( "table", { cellspacing: 0, cellpadding: 0 }, [ h(TableColgroup), h( "tbody", renderData.value.map((data, rowIndex) => { return h(TableRow, { data, rowIndex, key: data._key }); }) ) ] ) ] ); }; } }); export { TableBody as default };