如何在新的 toastr 出现时隐藏通知

How to hide notification when new one comes up with toastr

我的应用程序中弹出通知,我希望在新通知出现时隐藏旧通知(我不希望同时显示两个通知)。

如何使用 toastr 实现这种效果?

您可以使用 clear 函数:

toastr.clear();

希望对您有所帮助。

来源:officiel documentation.