Merge pull request #27 from iakta/feature/drop-events

Feature/drop events
This commit is contained in:
ayou
2019-03-15 22:49:45 +08:00
committed by GitHub
4 changed files with 13 additions and 2 deletions

View File

@@ -244,8 +244,11 @@
},
drop(e) {
if (!fromComp) return
const oldParent = fromComp.model.parent;
fromComp.model.moveInto(this.model)
this.isDragEnterNode = false
var node = this.getRootNode();
node.$emit('drop', {node: fromComp.model, oldParent: oldParent})
},
dragEnterUp () {
@@ -262,8 +265,11 @@
},
dropUp () {
if (!fromComp) return
const oldParent = fromComp.model.parent;
fromComp.model.insertBefore(this.model)
this.isDragEnterUp = false
var node = this.getRootNode();
node.$emit('drop-up', {node: fromComp.model, oldParent: oldParent})
},
dragEnterBottom () {
@@ -280,8 +286,11 @@
},
dropBottom () {
if (!fromComp) return
const oldParent = fromComp.model.parent;
fromComp.model.insertAfter(this.model)
this.isDragEnterBottom = false
var node = this.getRootNode();
node.$emit('drop-bottom', {node: fromComp.model, oldParent: oldParent})
},
getRootNode() {
var node = this.$parent