UNPKG

birdpaper-ui

Version:

一个通用的 vue3 UI组件库。A common vue3 UI component library.

40 lines (39 loc) 1.07 kB
import { defineComponent, computed } from "vue"; const _sfc_main = defineComponent({ name: "TableColumn", props: { /** 列标题 */ title: { type: String }, /** 行记录 */ record: { type: Object, default: () => { } }, /** 列标识字段 */ dataIndex: { type: String }, /** 行下标 */ rowIndex: { type: Number }, /** 列宽度 */ width: { type: [Number, String] }, /** 最小列宽 */ minWidth: { type: [Number, String] }, /** 对齐方式 */ align: { type: String, default: "left" }, /** 是否开启文本省略 */ ellipsis: { type: Boolean, default: false }, /** 是否开启文本气泡提示 */ tooltip: { type: Boolean, default: false } }, setup(props, { slots }) { const hasCustomCell = computed(() => !!(slots == null ? void 0 : slots.cell)); const tdClass = computed(() => { let align = `text-${props.align || "left"}`; return ["bp-table-td", align]; }); return { hasCustomCell, tdClass }; } }); export { _sfc_main as default };