From 313af63f3348c9deb7a716e1836be6b26ca477d9 Mon Sep 17 00:00:00 2001
From: chenghongxing <1126263215@qq.com>
Date: Wed, 30 Sep 2020 19:39:26 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20add=20function=20of=20refreshing=20page?=
=?UTF-8?q?;=20:star:=20#132=20=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=88=B7?=
=?UTF-8?q?=E6=96=B0=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/menu/Contextmenu.vue | 18 +++----
src/layouts/tabs/TabsHead.vue | 55 +++++++++++++++-------
src/layouts/tabs/TabsView.vue | 73 +++++++++++++++++++----------
src/layouts/tabs/i18n.js | 3 ++
src/plugins/tabs-page-plugin.js | 4 ++
5 files changed, 102 insertions(+), 51 deletions(-)
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"
>