直接上方法了 this.formData.jsonList 为数组,直接替换成你的就行了
hanldeTop( index) { console.log(index) if (index !== 0) { var tempOption = this.formData.jsonList[index - 1] //存储前一个 this.$set( this.formData.jsonList, index - 1, this.formData.jsonList[index] ) this.$set(this.formData.jsonList, index, tempOption) } }, hanldeBottom(index) { if (index !== 0) { var tempOption = this.formData.jsonList[index + 1] //存储后一个 this.$set( this.formData.jsonList, index + 1, this.formData.jsonList[index] ) this.$set(this.formData.jsonList, index, tempOption) } },