From e51e9fe8bac126f34f763521787bd35f115d4d02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=95?= Date: Thu, 10 May 2018 11:56:49 +0800 Subject: [PATCH] Tree: drag events should return if not draggable (#11095) --- packages/tree/src/tree-node.vue | 3 +++ test/unit/specs/menu.spec.js | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index 03708b09..22ea6a19 100644 --- a/packages/tree/src/tree-node.vue +++ b/packages/tree/src/tree-node.vue @@ -208,10 +208,12 @@ }, handleDragStart(event) { + if (!this.tree.draggable) return; this.tree.$emit('tree-node-drag-start', event, this); }, handleDragOver(event) { + if (!this.tree.draggable) return; this.tree.$emit('tree-node-drag-over', event, this); event.preventDefault(); }, @@ -221,6 +223,7 @@ }, handleDragEnd(event) { + if (!this.tree.draggable) return; this.tree.$emit('tree-node-drag-end', event, this); } }, diff --git a/test/unit/specs/menu.spec.js b/test/unit/specs/menu.spec.js index 32e5b426..3534d22a 100644 --- a/test/unit/specs/menu.spec.js +++ b/test/unit/specs/menu.spec.js @@ -372,7 +372,6 @@ describe('Menu', () => { template: `