diff --git a/src/components/menu/Contextmenu.vue b/src/components/menu/Contextmenu.vue
index a93e332..0bec4b4 100644
--- a/src/components/menu/Contextmenu.vue
+++ b/src/components/menu/Contextmenu.vue
@@ -33,6 +33,7 @@ export default {
left: 0,
top: 0,
target: null,
+ meta: null,
selectedKeys: []
}
},
@@ -45,14 +46,12 @@ export default {
}
},
created () {
- const clickHandler = () => this.closeMenu()
- const contextMenuHandler = e => this.setPosition(e)
- window.addEventListener('click', clickHandler)
- window.addEventListener('contextmenu', contextMenuHandler)
- this.$emit('hook:beforeDestroy', () => {
- window.removeEventListener('click', clickHandler)
- window.removeEventListener('contextmenu', contextMenuHandler)
- })
+ window.addEventListener('click', this.closeMenu)
+ window.addEventListener('contextmenu', this.setPosition)
+ },
+ beforeDestroy() {
+ window.removeEventListener('click', this.closeMenu)
+ window.removeEventListener('contextmenu', this.setPosition)
},
methods: {
closeMenu () {
@@ -62,9 +61,10 @@ export default {
this.left = e.clientX
this.top = e.clientY
this.target = e.target
+ this.meta = e.meta
},
handleClick ({ key }) {
- this.$emit('select', key, this.target)
+ this.$emit('select', key, this.target, this.meta)
this.closeMenu()
}
}
diff --git a/src/layouts/tabs/TabsHead.vue b/src/layouts/tabs/TabsHead.vue
index 17e74db..69432f3 100644
--- a/src/layouts/tabs/TabsHead.vue
+++ b/src/layouts/tabs/TabsHead.vue
@@ -5,9 +5,6 @@
:class="['tabs-container', layout, pageWidth, {'affixed' : affixed, 'fixed-header' : fixedHeader, 'collapsed' : adminLayout.collapsed}]"
:active-key="active"
:hide-add="true"
- @change="onChange"
- @edit="onEdit"
- @contextmenu="onContextmenu"
>