Tree: drag events should return if not draggable (#11095)

This commit is contained in:
杨奕 2018-05-10 11:56:49 +08:00 committed by GitHub
parent a318c5701e
commit e51e9fe8ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}
},

View File

@ -372,7 +372,6 @@ describe('Menu', () => {
template: `
<el-menu :default-active="active">
<el-menu-item
v-ref="menus"
v-for="menu in menus"
:index="menu.name"
:key="menu.name">