Refactor #3983 - For TreeTable

This commit is contained in:
Tuğçe Küçükoğlu 2023-06-05 11:36:46 +03:00
parent a5ec0a6b9f
commit 5b450d2ecc
6 changed files with 65 additions and 31 deletions

View file

@ -1,5 +1,5 @@
<template>
<td :style="containerStyle" :class="containerClass" role="cell" v-bind="{ ...getColumnPTOptions('root'), ...getColumnPTOptions('footerCell') }">
<td :style="containerStyle" :class="containerClass" role="cell" v-bind="{ ...getColumnPT('root'), ...getColumnPT('footerCell') }">
<component v-if="column.children && column.children.footer" :is="column.children.footer" :column="column" />
{{ columnProp('footer') }}
</td>
@ -16,6 +16,10 @@ export default {
column: {
type: Object,
default: null
},
index: {
type: Number,
default: null
}
},
data() {
@ -37,14 +41,19 @@ export default {
columnProp(prop) {
return ObjectUtils.getVNodeProp(this.column, prop);
},
getColumnPTOptions(key) {
return this.ptmo(this.getColumnProp(), key, {
getColumnPT(key) {
const columnMetaData = {
props: this.column.props,
parent: {
props: this.$props,
state: this.$data
},
context: {
index: this.index
}
});
};
return { ...this.ptm(`column.${key}`, { column: columnMetaData }), ...this.ptmo(this.getColumnProp(), key, columnMetaData) };
},
getColumnProp() {
return this.column.props && this.column.props.pt ? this.column.props.pt : undefined;