element-ui Message 消息提示文字换行

element-ui Message消息提示文字换行

直接上代码

pullMsgWithLine(title,msg) {
// \r\n 后台传上来的换行符,这里做分隔符
let returnMsgList = msg.split(’\r\n’);
let newDatas = [],h = this. c r e a t e E l e m e n t ; n e w D a t a s . p u s h ( ′ 导 入 文 件 ′ + t i t l e + ′ 失 败 ! ′ ) ; / / 循 环 数 据 依 次 放 入 最 终 数 据 中 f o r ( c o n s t i i n r e t u r n M s g L i s t ) i f ( i ! = ′ 0 ′ ) n e w D a t a s . p u s h ( h ( ′ p ′ , n u l l , r e t u r n M s g L i s t [ i ] ) ) t h i s . createElement; newDatas.push('导入文件'+ title + ' 失败!'); // 循环数据 依次放入最终数据中 for (const i in returnMsgList) { if(i!='0') newDatas.push(h('p', null, returnMsgList[i])) } this. createElement;newDatas.push(+title+);//for(constiinreturnMsgList)if(i!=0)newDatas.push(h(p,null,returnMsgList[i]))this.message.error( newDatas);
},

博客设置页面,选择一款你喜欢的代码片高亮样式,下面展示同样高亮的 代码片.

// An highlighted block
pullMsgWithLine(title,msg) {
	  // \r\n 后台传上来的换行符,这里做分隔符
      let returnMsgList = msg.split('\r\n');
      let newDatas = [],h = this.$createElement;
      newDatas.push('导入文件'+ title + ' 失败!');
      // 循环数据 依次放入最终数据中
      for (const i in returnMsgList) {
        if(i!='0')  //第一行空行过滤
          newDatas.push(h('p', null, returnMsgList[i]))
      }
      this.$message.error( newDatas);
    },
    
this.pullMsgWithLine('导入失败',msg1);

效果图

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值