From a81eb935962df5a628f357a1c1d7fb071204d794 Mon Sep 17 00:00:00 2001 From: leejimqiu Date: Mon, 3 Jul 2023 14:44:41 +0800 Subject: [PATCH] fix(toast): resolve repeated event triggering --- src/toast/toast.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/toast/toast.ts b/src/toast/toast.ts index 42a0dc671..ced90018b 100644 --- a/src/toast/toast.ts +++ b/src/toast/toast.ts @@ -80,6 +80,7 @@ export default class Toast extends SuperComponent { }, hide() { + if (!this.data.visible) return; // 避免重复触发(页面关闭、定时关闭都会触发) this.setData({ visible: false }); this.data?.close?.(); this.triggerEvent('close');