fix: 拖拽节点到根节点报错
This commit is contained in:
parent
ad1c9d3ffe
commit
6bad2e75df
|
@ -11,6 +11,7 @@
|
|||
@edit="edit"
|
||||
@drag="drag"
|
||||
@remove="remove"
|
||||
@refresh="list"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
ref="nodeTree">
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
@edit="edit"
|
||||
@drag="drag"
|
||||
@remove="remove"
|
||||
@refresh="list"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
ref="nodeTree">
|
||||
|
||||
|
|
|
@ -220,6 +220,10 @@ export default {
|
|||
if (dropType === "none" || dropType === undefined) {
|
||||
return;
|
||||
}
|
||||
if (dropNode.data.id === 'root' && dropType === 'before') {
|
||||
this.$emit('refresh');
|
||||
return false;
|
||||
}
|
||||
let param = this.buildParam(draggingNode, dropNode, dropType);
|
||||
let list = [];
|
||||
this.getNodeTree(this.treeNodes, draggingNode.data.id, list);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
@drag="drag"
|
||||
@remove="remove"
|
||||
@nodeSelectEvent="nodeChange"
|
||||
@refresh="list"
|
||||
ref="nodeTree"/>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue