[new feature] Toast: add onOpened option

This commit is contained in:
陈嘉涵
2019-05-28 20:27:20 +08:00
parent 999be8064a
commit fecc82e69b
6 changed files with 37 additions and 9 deletions

View File

@@ -60,6 +60,14 @@ export default sfc({
const action = clickable ? 'add' : 'remove';
document.body.classList[action]('van-toast--unclickable');
}
},
onAfterEnter() {
this.$emit('opened');
if (this.onOpened) {
this.onOpened();
}
}
},
@@ -86,7 +94,7 @@ export default sfc({
}
return (
<transition name="van-fade">
<transition name="van-fade" onAfterEnter={this.onAfterEnter}>
<div vShow={this.value} class={[bem([style, this.position]), this.className]}>
{Content()}
</div>