|
@@ -76,18 +76,16 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
initSort() {
|
|
initSort() {
|
|
|
- console.log('执行了换个位置')
|
|
|
|
|
if (!this.isRowSort) return
|
|
if (!this.isRowSort) return
|
|
|
const el = this.$refs['table'].$el.querySelector('.el-table__body-wrapper > table > tbody')
|
|
const el = this.$refs['table'].$el.querySelector('.el-table__body-wrapper > table > tbody')
|
|
|
new Sortable(el, {
|
|
new Sortable(el, {
|
|
|
animation: 150, // 动画
|
|
animation: 150, // 动画
|
|
|
onEnd: evt => {
|
|
onEnd: evt => {
|
|
|
- console.log(evt,'evt11')
|
|
|
|
|
const curRow = this.data.splice(evt.oldIndex, 1)[0]
|
|
const curRow = this.data.splice(evt.oldIndex, 1)[0]
|
|
|
- console.log(curRow,'curRow22')
|
|
|
|
|
- this.data.splice(evt.newIndex, 0, curRow)
|
|
|
|
|
- console.log(this.data,'表格数据')
|
|
|
|
|
- this.$emit('rowSort', this.data)
|
|
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.data.splice(evt.newIndex, 0, curRow)
|
|
|
|
|
+ this.$emit('rowSort', this.data)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|