Drawer: Add before-hide event to Drawer component

pull/6838/head
Reddy Uppathi 2024-11-23 00:41:20 +05:30
parent bd7161298a
commit 666a33c21e
1 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,7 @@ export default {
name: 'Drawer', name: 'Drawer',
extends: BaseDrawer, extends: BaseDrawer,
inheritAttrs: false, inheritAttrs: false,
emits: ['update:visible', 'show', 'after-show', 'hide', 'after-hide'], emits: ['update:visible', 'show', 'after-show', 'hide', 'after-hide', 'before-hide'],
data() { data() {
return { return {
containerVisible: this.visible containerVisible: this.visible
@ -113,6 +113,8 @@ export default {
if (this.modal) { if (this.modal) {
!this.isUnstyled && addClass(this.mask, 'p-overlay-mask-leave'); !this.isUnstyled && addClass(this.mask, 'p-overlay-mask-leave');
} }
this.$emit('before-hide');
}, },
onLeave() { onLeave() {
this.$emit('hide'); this.$emit('hide');