From 5fdba8c0c31b2828c6a7d3c7219d8f62391eb0b6 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Fri, 7 Jun 2024 09:45:43 +0300 Subject: [PATCH] Fixed #5828 - ContextMenu:there are no emitters before-show and before-hide --- components/lib/contextmenu/ContextMenu.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/lib/contextmenu/ContextMenu.vue b/components/lib/contextmenu/ContextMenu.vue index b066a0a6a..f42d8d75c 100755 --- a/components/lib/contextmenu/ContextMenu.vue +++ b/components/lib/contextmenu/ContextMenu.vue @@ -44,7 +44,7 @@ export default { name: 'ContextMenu', extends: BaseContextMenu, inheritAttrs: false, - emits: ['focus', 'blur', 'show', 'hide'], + emits: ['focus', 'blur', 'show', 'hide', 'before-hide', 'before-show'], target: null, outsideClickListener: null, resizeListener: null, @@ -125,6 +125,7 @@ export default { this.visible ? this.hide() : this.show(event); }, show(event) { + this.$emit('before-show'); this.activeItemPath = []; this.focusedItemInfo = { index: -1, level: 0, parentKey: '' }; DomHandler.focus(this.list); @@ -137,6 +138,7 @@ export default { event.preventDefault(); }, hide() { + this.$emit('before-hide'); this.visible = false; this.activeItemPath = []; this.focusedItemInfo = { index: -1, level: 0, parentKey: '' };