辅助组件
This module is deprecated.
拖拽组件
示例:
<sw-drag @drag="handleDrag" @drop="handleDrop">
<div class="drag-demo">拖我出去</div>
</sw-drag>
handleDrag(position){
let prePosition = position.start
let nowPosition = position.move
this.distanceX = this.preDistanceX + nowPosition.x - prePosition.x
this.distanceY = this.preDistanceY + nowPosition.y - prePosition.y
this.setBoxPosition(this.distanceX,this.distanceY)
},
handleDrop(){
this.preDistanceX = this.distanceX
this.preDistanceY = this.distanceY
}
This module provides the following classes: