ivue-material-plus
Version:
A high quality UI components Library with Vue.js
53 lines (48 loc) • 1.07 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var IvueColgroup = vue.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 vue.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 vue.h(
"colgroup",
{},
columns.map((column) => this.renderCol(column))
);
}
});
exports["default"] = IvueColgroup;
//# sourceMappingURL=colgroup.js.map
;