
功能需求:项目中用到的$message消息提示的方式,但是停留时间过长,用到的地方太多,想全局改掉。
在main.js中添加一下配置:
import ElementUI from "element-ui"; //原先已引入ElementUI组件 //或者 import {Message} from 'element-ui' //注意:页面this.$message Vue.prototype.$message = function(msg) { return ElementUI.Message({ message: msg, duration: 1500 }) }; //分别对success、warning和error等样式进行设置 Vue.prototype.$message.success = function(msg) { return ElementUI.Message.success({ message: msg, duration: 1500 }) }; Vue.prototype.$message.warning = function(msg) { return ElementUI.Message.warning({ message: msg, duration: 1500 }) }; Vue.prototype.$message.error = function(msg) { return ElementUI.Message.error({ message: msg, duration: 1500 }) }
element-ui时间选择器el-date-picker默认当前时间至7天之前时间
标签: el-message, element-ui, 全局
上面是“ElementUI全局修改el-message停留时间”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_2106.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

美图集:一款提供海量高清图片和壁纸的免费下载平台
AlphaSense:金融专业人士专属AI搜索工具,智驱高效决策
jquery如何创建和删除cookie中值
咪咕文学:中国移动旗下的数字阅读平台,挖掘和培育优秀网络作家
6080YY电影天堂影视平台,一款功能丰富的影视播放平台
Algolia Al:一家提供即搜索即服务Search‑as‑a‑Service的云平台