全局修改elementUI的$message默认显示时间的方法

在main.js文件中

import ElementUI from 'element-ui'


const Message = ElementUI.Message;
ElementUI.Message = function (options) {
    options = {
        duration: 7000,
        ...options
    }
    return Message(options);
}
Vue.use(ElementUI)

重写Message方法

posted @ 2020-12-01 18:42  墨染清浅  阅读(3902)  评论(3)    收藏  举报