Fixed #1428 - [feature request]Please add event while menu/overlay is dismissed

pull/1478/head
Tuğçe Küçükoğlu 2021-08-25 14:46:46 +03:00
parent eef5c7a80d
commit d924dbac8d
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import Menuitem from './Menuitem.vue';
export default { export default {
name: 'Menu', name: 'Menu',
emits: ['show', 'hide'],
inheritAttrs: false, inheritAttrs: false,
props: { props: {
popup: { popup: {
@ -117,11 +118,14 @@ export default {
if (this.autoZIndex) { if (this.autoZIndex) {
ZIndexUtils.set('menu', el, this.baseZIndex + this.$primevue.config.zIndex.menu); ZIndexUtils.set('menu', el, this.baseZIndex + this.$primevue.config.zIndex.menu);
} }
this.$emit('show');
}, },
onLeave() { onLeave() {
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindResizeListener(); this.unbindResizeListener();
this.unbindScrollListener(); this.unbindScrollListener();
this.$emit('hide');
}, },
onAfterLeave(el) { onAfterLeave(el) {
if (this.autoZIndex) { if (this.autoZIndex) {