Refactor #4149 - For DataTable & Column & ColumnGroup

This commit is contained in:
Tuğçe Küçükoğlu 2023-07-19 15:05:06 +03:00
parent dcd76d09cc
commit 97d112a2e0
13 changed files with 195 additions and 37 deletions

View file

@ -1,5 +1,5 @@
<template>
<thead :class="cx('thead')" :style="sx('thead')" role="rowgroup" v-bind="columnGroup ? { ...ptm('thead'), ...getColumnGroupPT('root') } : ptm('thead')" data-pc-section="thead">
<thead :class="cx('thead')" :style="sx('thead')" role="rowgroup" v-bind="columnGroup ? { ...ptm('thead', ptmTHeadOptions), ...getColumnGroupPT('root') } : ptm('thead', ptmTHeadOptions)" data-pc-section="thead">
<template v-if="!columnGroup">
<tr role="row" v-bind="ptm('headerRow')">
<template v-for="(col, i) of columns" :key="columnProp(col, 'columnKey') || columnProp(col, 'field') || i">
@ -244,7 +244,8 @@ export default {
state: this.$data
},
context: {
type: 'header'
type: 'header',
scrollable: this.$parentInstance?.$parentInstance?.scrollable
}
};
@ -323,6 +324,15 @@ export default {
}
}
},
computed: {
ptmTHeadOptions() {
return {
context: {
scrollable: this.$parentInstance?.$parentInstance?.scrollable
}
};
}
},
components: {
DTHeaderCell: HeaderCell,
DTHeaderCheckbox: HeaderCheckbox,