在我的 vue.js 应用程序中,我正在尝试像这样交换 2 个论坛行:
export default {
data() {
return {
forums: []
}
},
methods: {
increment(forum, index) {
ForumService.increment(forum)
.then(() => {
let b = this.forums[index];
this.forums[index] = this.forums[index++];
this.forums[index++] = b;
});
}
}
}
但是什么也没有发生?我在这里做错了什么吗?
this.forums.splice(index, 2, this.forums[index + 1], this.forums[index]);
就足够了。 - dfsqthis.forums.splice(index, 2, rows[1], rows[0] );
。 - dfsq