以下是我的html示例:
<p-toast key="key1" position="bottom-right" [preventOpenDuplicates]="true"></p-toast>
<p-toast key="key2" position="bottom-right" [preventOpenDuplicates]="true"></p-toast>
每个祝wine 词指的是特定类型的系统通知,因此可以有 Select 地只清除一个通知以及所有通知.
但在我的组件中,如果我通过以下命令触发上述所有键:
this.messageService.add({key: 'key1',severity: 'error',summary: 'Notification',detail: 'Detail Err',life: 2000,sticky: true});
this.messageService.add({key: 'key2',severity: 'warn',summary: 'Notification',detail: 'Detail Warning !!!',life: 2000,sticky: true});
结果将由两个重叠的祝wine 词组成:
最后,我们转到主要问题:是否可以堆叠上面的 cogo toast ,就像它们有一些键一样,没有键的toast html标记的行为如下:
当然,保留了 Select 性地关闭所需 cogo toast 的能力.
提前谢谢你