如何将data中字符传的换行正常显示

后端传来的字符串有换行符:

 直接输出的效果:

 解决方法demo:

<p class="" v-html="text"></p>
js:
let str=res.rows[0].text.replace(/ /g,"<br/>")
               this.text = str
效果:
原文地址:https://www.cnblogs.com/wd163/p/12739964.html