Skip to content

Commit

Permalink
fix(VData): reset sortBy & sortDesc when they are empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed Jan 2, 2022
1 parent 6651e23 commit 5bf1293
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vuetify/src/components/VData/VData.ts
Expand Up @@ -328,7 +328,12 @@ export default Vue.extend({
this.internalOptions.mustSort,
this.internalOptions.multiSort
)
this.updateOptions({ sortBy, sortDesc, page })

this.updateOptions({
sortBy: sortBy.length ? sortBy : [''], // When array is empty, reset to its initial value
sortDesc: sortDesc.length ? sortDesc : [false], // When array is empty, reset to its initial value
page,
})
},
sortArray (sortBy: string[]) {
const sortDesc = sortBy.map(s => {
Expand Down

0 comments on commit 5bf1293

Please sign in to comment.