[Vuejs]-Vuejs data updates but the change does not reflect in template

1👍

Use Vue.set when changing values in the array.

Vue.set(this.heights, j, this.heights[j+1]);
Vue.set(this.heights, j+1, tmp);

Or copy the array, sort the copy and then assign it to this.height. This will also work.

Leave a comment