element-plus的ElNotification 内容换行显示

效果图:

 

代码:

const excelSuccess = ({ data, status, message }) => {
  if (status === 20005) {
    const msg = message.replace(/\,/g, "<br />");//把,替换成换行符<br />
    ElNotification({
      dangerouslyUseHTMLString: true,//加此属性<br/>才会生效
      message: `你上传的文件里面,以下工资编码出现过两次以上,工资编码是用户唯一标识符,不允许重复,请先修正。<br />${msg}`,
      type: "error",
      duration: 0, //消息存在时间,0表示一直存在
     
    });
  } else {
    ElNotification({
      message: message || "导入有误",
      type: "error",
    });
  }
 
};

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-05-14 11:04:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-05-14 11:04:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-05-14 11:04:03       87 阅读
  4. Python语言-面向对象

    2024-05-14 11:04:03       96 阅读

热门阅读

  1. 水利行业工程设计资质如何去申请

    2024-05-14 11:04:03       31 阅读
  2. vue预览PDF文件的方法

    2024-05-14 11:04:03       28 阅读
  3. Flink Stream API实践

    2024-05-14 11:04:03       28 阅读
  4. 13.复习1笔记

    2024-05-14 11:04:03       28 阅读
  5. Gitee使用教程

    2024-05-14 11:04:03       32 阅读
  6. VsionPro

    2024-05-14 11:04:03       28 阅读
  7. C语言从头学05——头文件及库文件

    2024-05-14 11:04:03       28 阅读
  8. linux程序分析命令(三)

    2024-05-14 11:04:03       29 阅读
  9. 【设计模式】23种设计模式概览及应用示例

    2024-05-14 11:04:03       26 阅读
  10. 21.JVM的垃圾回收算法

    2024-05-14 11:04:03       30 阅读
  11. elementui中close-on-click-modal=“fasle“不生效

    2024-05-14 11:04:03       28 阅读
  12. CentOS 初始化配置事项

    2024-05-14 11:04:03       21 阅读
  13. SpringBoot学习记录(3)

    2024-05-14 11:04:03       35 阅读
  14. 牛客Linux高并发服务器开发学习第六天

    2024-05-14 11:04:03       37 阅读