Skip to content

Commit

Permalink
fix: 修复 toast hide 判空问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yhy committed Aug 9, 2023
1 parent 40ec501 commit d721a96
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/quarkd/src/toast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ class QuarkToast extends QuarkElement {
}

hide = () => {
document.body.removeChild(this);
const el = document.querySelector("quark-toast");
if (el) {
document.body.removeChild(this);
}
if (this.type === "loading") clearAllBodyScrollLocks();
};

Expand Down Expand Up @@ -269,6 +272,7 @@ export default {
},

hide: function () {
console.log(toast, "toast");
if (toast) toast.hide();
},

Expand Down

0 comments on commit d721a96

Please sign in to comment.