element Notification 通知文字换行小技巧

this.$notify({
            title: "通知",
            message: res.result,
            iconClass: "el-icon-bell",//自定义icon
            offset: 100,
            customClass: "stylecss",//自定义类名
            duration: 0,//停留时间(单位毫秒,默认4500)0就是不关闭
          });
.stylecss {
  word-wrap: break-word;
  word-break: break-all;
}

element-ui api有customClass 可以用于自定义class名。
1.先定义customClass一个属性,用来写class属性值

2.之后还需要修改一下组件里style标签的scoped,并且写对应的css。

posted @ 2020-09-04 08:35  11个条子  阅读(2204)  评论(0编辑  收藏  举报