Refactor on DataTable

pull/14/head
mertsincan 2019-07-02 12:02:55 +03:00
parent ff20a00e8f
commit 3ce0a109d2
1 changed files with 8 additions and 2 deletions

View File

@ -162,7 +162,7 @@ export default {
},
data() {
return {
columns: [],
allChildren: null,
d_first: this.first,
d_rows: this.rows,
d_sortField: this.sortField,
@ -184,7 +184,7 @@ export default {
}
},
mounted() {
this.columns = this.$children.filter(child => child.$options._propKeys.indexOf('columnKey') !== -1);
this.allChildren = this.$children;
},
methods: {
getRowKey(rowData, index) {
@ -264,6 +264,12 @@ export default {
}
},
computed: {
columns() {
if (this.allChildren) {
return this.allChildren.filter(child => child.$options._propKeys.indexOf('columnKey') !== -1);
}
return [];
},
data() {
if (this.value && this.value.length) {
let data = this.value;