Skip to content

Commit c586168

Browse files
committed
fix(toast): 修复toast已隐藏,页面无法点击
1 parent b74da77 commit c586168

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/mixins/transition.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default function transition() {
3131
created() {
3232
this.status = '';
3333
this.transitionT = 0;
34+
this.transitionEndStatus = false;
3435
},
3536
attached() {
3637
this.durations = this.getDurations();
@@ -82,6 +83,11 @@ export default function transition() {
8283
});
8384
},
8485
leave() {
86+
if (this.data.preventScrollThrough && !this.transitionEndStatus) {
87+
this.setData({
88+
realVisible: false,
89+
});
90+
}
8591
const { name } = this.data;
8692
const [, duration] = this.durations;
8793
this.status = 'leaving';
@@ -112,6 +118,7 @@ export default function transition() {
112118
if (this.customDuration) {
113119
return;
114120
}
121+
this.transitionEndStatus = true;
115122

116123
clearTimeout(this.transitionT);
117124
if (this.status === 'entering' && this.data.visible) {

0 commit comments

Comments
 (0)