Skip to content

Commit

Permalink
fixes #733
Browse files Browse the repository at this point in the history
  • Loading branch information
xaksis committed Mar 2, 2021
1 parent 3a3934d commit 4659e10
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ export default {
initializeSort() {
const { enabled, initialSortBy, multipleColumns } = this.sortOptions;
const initSortBy = JSON.parse(JSON.stringify(initialSortBy));
if (typeof enabled === 'boolean') {
this.sortable = enabled;
Expand All @@ -1592,18 +1593,18 @@ export default {
}
//* initialSortBy can be an array or an object
if (typeof initialSortBy === 'object') {
if (typeof initSortBy === 'object') {
const ref = this.fixedHeader
? this.$refs['table-header-secondary']
: this.$refs['table-header-primary'];
if (Array.isArray(initialSortBy)) {
ref.setInitialSort(initialSortBy);
if (Array.isArray(initSortBy)) {
ref.setInitialSort(initSortBy);
} else {
const hasField = Object.prototype.hasOwnProperty.call(
initialSortBy,
initSortBy,
'field'
);
if (hasField) ref.setInitialSort([initialSortBy]);
if (hasField) ref.setInitialSort([initSortBy]);
}
}
},
Expand Down

0 comments on commit 4659e10

Please sign in to comment.