[new feature] Popup: add click event

This commit is contained in:
陈嘉涵
2019-04-30 19:10:19 +08:00
parent ef77166246
commit 848786dd6e
5 changed files with 21 additions and 4 deletions
+2 -2
View File
@@ -25,7 +25,7 @@ export default sfc({
}
const { position } = this;
const emit = event => () => this.$emit(event);
const emit = eventName => event => this.$emit(eventName, event);
const transitionName = this.transition || (position ? `van-popup-slide-${position}` : 'van-fade');
return (
@@ -34,7 +34,7 @@ export default sfc({
onAfterEnter={emit('opened')}
onAfterLeave={emit('closed')}
>
<div vShow={this.value} class={bem({ [position]: position })}>
<div vShow={this.value} class={bem({ [position]: position })} onClick={emit('click')}>
{this.slots()}
</div>
</transition>