ivue-material-plus
Version:
A high quality UI components Library with Vue.js
49 lines (46 loc) • 1 kB
JavaScript
import { defineComponent, h } from 'vue';
var IvueColgroup = defineComponent({
props: {
columns: {
type: Array,
default: () => []
},
tableLayout: {
type: String
}
},
methods: {
renderCol(column) {
const isAuto = this.tableLayout === "auto";
const obj = {
key: `${this.tableLayout}-${column.id}`,
style: {},
name: void 0
};
if (isAuto) {
obj.style = {
width: `${column.width}px`
};
} else {
obj.name = column.id;
}
return h("col", obj);
}
},
render(props) {
const isAuto = props.tableLayout === "auto";
let columns = props.columns || [];
if (isAuto) {
if (columns.every((column) => column.width === void 0)) {
columns = [];
}
}
return h(
"colgroup",
{},
columns.map((column) => this.renderCol(column))
);
}
});
export { IvueColgroup as default };
//# sourceMappingURL=colgroup.mjs.map