日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

ant 循環多條通知提醒框堆疊問題

作者:青色檸檬雨 更新時間: 2023-12-07 編程語言

?ant 低版本中循環多條通知時通知提示框會出現堆疊的問題最后一條會顯示在界面上,關閉第一條才會顯示倒數第二條信息,我想要所有通知都平鋪,用Promise 或者nextTick和setTimeout都可以達到效果,我這里用了Promise

  // data中定義  tippromise: Promise.resolve(),   
 funtIp() {
 var   tip= [
                { title: "信息一", text: "病人一", key: 1 },
                { title: "信息二", text: "病人二", key: 2 },
                { title: "信息三", text: "病人三", key: 3 },
            ],
            this.tip.forEach(res => {
                const key = res.key;
                this.tippromise = this.tippromise.then(() => {
                    this.$notification.open({
                        message: `預警信息 `,//${placement}
                        description: res.title,

                        placement: "bottomRight",
                        duration: 0,

                        btn: h => {
                            return h(
                                'a-button',
                                {
                                    props: {
                                        type: 'primary',
                                        size: 'small',
                                    },
                                    on: {
                                        click: () => this.$notification.close(key),
                                    },
                                },
                                '已讀',
                            );
                        },
                        key,
                        onClose: close,
                    });

                })
            })

            //   openNotification() {

            // },

        },

效果

原文鏈接:https://blog.csdn.net/lfalt/article/details/133807560

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新