vue + Element UI的Notification通知

vue + Element UI的Notification通知

比较简单

效果图
在这里插入图片描述源码
var msg = new Vue({
el: “#Message”,
data: {
list: [
{ msg: “请输入用户名”, title: “错误”, type: “error”, duration:0 },
{ msg: “登录成功”, title: “成功”, type: “success”, duration: 3000 },
{ msg: “账号安全警告”, title: “警告”, type: “warning”, duration: 8000 },
{ msg: “类型通知内容消失时间自定义类型通知内容消失时间自定义类型通知内容消失时间自定义”, title: “通知”, type: “info”, duration: 0 }
]
},
methods: {
Message: async function (data) {
for (var i = 0; i < data.length; i++) {
await this.KaTeX parse error: Expected '}', got 'EOF' at end of input: … type: `{data[i].type}, title:d a t a [ i ] . t i t l e ‘ , m e s s a g e : ‘ {data[i].title}`, message: `data[i].title,message:{data[i].msg}`,
duration: data[i].duration
})
}
}
},
mounted() {
this.Message(this.list);
}
});
在这里插入图片描述


版权声明:本文为m0_45192514原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。