很多人在实际业务场景遇到这种报错提示:
报错提示一闪而过,客户需求报错提示能够停留在页面,并且能手动关闭。
直接上效果图:
在网上看到了:
this.$message({...,duration:0})
只写duration的话还得手写关闭的方法 。
我们只需添加一个参数。showClose:true
就能做到报错信息一直存在页面,手动关闭消失。
this.$message({
type: "error",
message: "错误的用户信息或密码",
showClose: true,
duration:0,
});