Merge pull request #4729 from nodephp/2.0

add dragdrop for tr
This commit is contained in:
Aresn 2019-03-04 16:49:08 +08:00 committed by GitHub
commit cd8302d5be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 4 deletions

View file

@ -1,6 +1,6 @@
<template>
<div>
<Table ref="currentRowTable" :columns="columns3" :data="data1"></Table>
<Table ref="currentRowTable" :columns="columns3" :data="data1" :draggable="true" @on-drag-drop="onDragDrop"></Table>
<Button @click="handleClearCurrentRow">Clear</Button>
</div>
</template>
@ -62,6 +62,10 @@
methods: {
handleClearCurrentRow () {
this.$refs.currentRowTable.clearCurrentRow();
},
onDragDrop(a,b){
console.log(a,b);
this.data1.splice(b,1,...this.data1.splice(a, 1 , this.data1[b]));
}
}
}