美文网首页
ElementUI 全局设置

ElementUI 全局设置

作者: Cherry丶小丸子 | 来源:发表于2020-11-18 15:41 被阅读0次

ElementUI GitHub地址

https://github.com/ElemeFE/element/

在某个组件中全局配置,只需要在mouted()钩子函数中写入

mounted() {
    this.$message.config({
        duration: 3
    });
    this.$notify.config({
        duration: 3
    });
}

在整个项目中全局配置,需要在main.js中写入

Vue.prototype.$message.config({
    duration: 3
});
Vue.prototype.$notify.config({
    duration: 3
});

相关文章

网友评论

      本文标题:ElementUI 全局设置

      本文链接:https://www.haomeiwen.com/subject/lmuciktx.html