diff --git a/src/views/table/drag-table.vue b/src/views/table/drag-table.vue index 3b5c890a0ebbb9dd062b58c9b41a4bf1dcfbcba4..95c3f094090206976edd7cd24c52895978e6d33e 100644 --- a/src/views/table/drag-table.vue +++ b/src/views/table/drag-table.vue @@ -117,8 +117,14 @@ export default { dataTransfer.setData('Text', '') }, onEnd: evt => { - const targetRow = this.list.splice(evt.oldIndex, 1)[0] - this.list.splice(evt.newIndex, 0, targetRow) + let tmpArray = this.list + const targetRow = tmpArray.splice(evt.oldIndex, 1)[0] + + this.list = [] + this.$nextTick(() => { + tmpArray.splice(evt.newIndex, 0, targetRow) + this.list = tmpArray + }) // for show the changes, you can delete in you code const tempIndex = this.newList.splice(evt.oldIndex, 1)[0]