Fixed #1646 - Kebab-case properties are not working on DataTable and TreeTable

pull/1664/head
mertsincan 2021-10-07 09:26:26 +03:00
parent 5c48a12347
commit 306b38ef5d
6 changed files with 10 additions and 8 deletions

View File

@ -428,7 +428,7 @@ export default {
}, },
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
}, },
onPage(event) { onPage(event) {
this.clearEditingMetaData(); this.clearEditingMetaData();

View File

@ -193,7 +193,7 @@ export default {
}, },
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
}, },
shouldRenderRowGroupHeader(value, rowData, i) { shouldRenderRowGroupHeader(value, rowData, i) {
let currentRowFieldData = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy); let currentRowFieldData = ObjectUtils.resolveFieldData(rowData, this.groupRowsBy);

View File

@ -17,6 +17,7 @@
<script> <script>
import FooterCell from './FooterCell.vue'; import FooterCell from './FooterCell.vue';
import {ObjectUtils} from 'primevue/utils';
export default { export default {
name: 'TableFooter', name: 'TableFooter',
@ -32,7 +33,7 @@ export default {
}, },
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
} }
}, },
computed: { computed: {

View File

@ -51,6 +51,7 @@
import HeaderCell from './HeaderCell.vue'; import HeaderCell from './HeaderCell.vue';
import HeaderCheckbox from './HeaderCheckbox.vue'; import HeaderCheckbox from './HeaderCheckbox.vue';
import ColumnFilter from './ColumnFilter.vue'; import ColumnFilter from './ColumnFilter.vue';
import {ObjectUtils} from 'primevue/utils';
export default { export default {
name: 'TableHeader', name: 'TableHeader',
@ -121,7 +122,7 @@ export default {
}, },
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
}, },
getFilterColumnHeaderClass(column) { getFilterColumnHeaderClass(column) {
return ['p-filter-column', this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class'), { return ['p-filter-column', this.columnProp(column, 'filterHeaderClass'), this.columnProp(column, 'class'), {

View File

@ -280,7 +280,7 @@ export default {
}, },
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
}, },
onNodeToggle(node) { onNodeToggle(node) {
const key = node.key; const key = node.key;

View File

@ -15,7 +15,7 @@
</template> </template>
<script> <script>
import {DomHandler} from 'primevue/utils'; import {DomHandler, ObjectUtils} from 'primevue/utils';
import BodyCell from './BodyCell.vue'; import BodyCell from './BodyCell.vue';
export default { export default {
@ -58,7 +58,7 @@ export default {
nodeTouched: false, nodeTouched: false,
methods: { methods: {
columnProp(col, prop) { columnProp(col, prop) {
return col.props ? ((col.type.props[prop].type === Boolean && col.props[prop] === '') ? true : col.props[prop]) : null; return ObjectUtils.getVNodeProp(col, prop);
}, },
toggle() { toggle() {
this.$emit('node-toggle', this.node); this.$emit('node-toggle', this.node);