UNPKG

@gitlab/ui

Version:
31 lines (25 loc) 683 B
import { extend } from '../../../vue'; import { SLOT_NAME_TABLE_COLGROUP } from '../../../constants/slots'; // --- Props --- const props = {}; // --- Mixin --- // @vue/component const colgroupMixin = extend({ methods: { renderColgroup() { const fields = this.computedFields; const h = this.$createElement; let $colgroup = h(); if (this.hasNormalizedSlot(SLOT_NAME_TABLE_COLGROUP)) { $colgroup = h('colgroup', { key: 'colgroup' }, [this.normalizeSlot(SLOT_NAME_TABLE_COLGROUP, { columns: fields.length, fields })]); } return $colgroup; } } }); export { colgroupMixin, props };