[new feature] Popup: add opened/closed event (#2650)

This commit is contained in:
neverland
2019-01-30 19:43:17 +08:00
committed by GitHub
parent 466bb3ce1e
commit 01c893abcb
3 changed files with 10 additions and 1 deletions
+6 -1
View File
@@ -25,10 +25,15 @@ export default sfc({
}
const { position } = this;
const emit = event => () => this.$emit(event);
const transitionName = this.transition || (position ? `van-popup-slide-${position}` : 'van-fade');
return (
<transition name={transitionName}>
<transition
name={transitionName}
onAfterEnter={emit('opened')}
onAfterLeave={emit('closed')}
>
<div vShow={this.value} class={bem({ [position]: position })}>
{this.$slots.default}
</div>