mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[new feature] Toast: add onOpened option
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user