Vue.js swap array items Vue.js swap array items vue.js vue.js

Vue.js swap array items


While @dfsq is correct about the use of index++ Vue doesn't recognize native mutations of arrays due to the inability to observe them. you have to use a mutation method to change them.

try this:

.then(() => {  let rows = [this.forums[index], this.forums[index + 1]];  this.forums.splice(index, 2, rows[1], rows[0] );});

I haven't tested it and I'll edit when I can.