..................
.....
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
// 表格拖拽
function customRow(record, index) {
if (props.isDrag) {
return {
style: {
cursor: 'move'
},
// 鼠标移入
onMouseenter: event => {
var ev = event || window.event
ev.target.draggable = true
},
// 开始拖拽
onDragstart: event => {
var ev = event || window.event
ev.stopPropagation()
state.index1= index
},
// 拖动元素经过的元素
onDragover: event => {
var ev = event || window.event
ev.preventDefault()
},
// 鼠标松开
onDrop: event => {
var ev = event || window.event
ev.stopPropagation()
state.index2= index
[state.datasource[state.index1], state.datasource[state.index2]] = [
state.datasource[state.index2],
state.datasource[state.index1]
]
}
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36