feat(event): add drop-before and drop-after

This commit is contained in:
youxingzhi
2019-07-17 09:54:04 +08:00
parent 6154cfd1ad
commit cf41282fcf
5 changed files with 44 additions and 28 deletions

View File

@@ -6,6 +6,9 @@
@change-name="onChangeName"
@delete-node="onDel"
@add-node="onAddNode"
@drop="drop"
@drop-before="dropBefore"
@drop-after="dropAfter"
:model="data"
default-tree-node-name="new node"
default-leaf-node-name="new leaf"
@@ -81,6 +84,18 @@
console.log(params)
},
drop: function ({node, src, target}) {
console.log('drop', node, src, target)
},
dropBefore: function ({node, src, target}) {
console.log('drop-before', node, src, target)
},
dropAfter: function ({node, src, target}) {
console.log('drop-after', node, src, target)
},
addNode () {
var node = new TreeNode({ name: 'new node', isLeaf: false })
if (!this.data.children) this.data.children = []