后端返回字符串中带换行符,前端需转换

let remarkStr =' '

remarkStr = remarkStr.replace(/\n/g,"<br/>")
        
this.remark = remarkStr
<span v-html="remark"></span>

 另外原生参考方法:

https://www.itranslater.com/qa/details/2106874997112308736

https://segmentfault.com/a/1190000003936301

https://www.cnblogs.com/jinbang/p/6790592.html

  

posted @ 2019-07-03 16:47  小蓉儿  阅读(5198)  评论(0编辑  收藏  举报