birdpaper-ui
Version:
一个通用的 vue3 UI组件库。A common vue3 UI component library.
39 lines (38 loc) • 1.07 kB
JavaScript
;
const vue = require("vue");
const _sfc_main = vue.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 = vue.computed(() => !!(slots == null ? void 0 : slots.cell));
const tdClass = vue.computed(() => {
let align = `text-${props.align || "left"}`;
return ["bp-table-td", align];
});
return {
hasCustomCell,
tdClass
};
}
});
module.exports = _sfc_main;