Check out this updated grid example from the official examples. In my application, I need to reposition the sortOrders array.
created: function () {
var vm = this;
this.columns.forEach(function (key) {
vm.sortOrders[key] = 1
})
},
I attempted to sort a column, but the sorting only occurs once.
To replicate the issue: Click on the "name" column header more than once. Expectation: The column should be sorted each time the header is clicked. Reality: The column is only sorted once.
I'm puzzled as to why
Vue.set(this.sortOrders, key, order);
does not update the this.sortOrders
variable.
It works correctly if a temporary variable is used like so:
var order = this.sortOrders[key]*-1;
var tmp = this.sortOrders ;
Vue.set(tmp, key, order);
this.sortOrders = [];
this.sortOrders = tmp;