Merge pull request #6838 from sivareddyuppathi/drawer-add-before
Drawer: Add before-hide event to Drawer componentpull/7055/head
commit
51ab19a263
|
@ -259,6 +259,10 @@ export interface DrawerEmitsOptions {
|
||||||
* Callback to invoke when drawer is shown.
|
* Callback to invoke when drawer is shown.
|
||||||
*/
|
*/
|
||||||
show(): void;
|
show(): void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke before drawer gets hidden.
|
||||||
|
*/
|
||||||
|
'before-hide'(): void;
|
||||||
/**
|
/**
|
||||||
* Callback to invoke when drawer gets hidden.
|
* Callback to invoke when drawer gets hidden.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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');
|
||||||
|
|
Loading…
Reference in New Issue