v-html对于↵转义的问题

方法1 用pre标签展示
<pre v-html>
    
</pre>

方法2 浏览器处理换行的时候,会进行自动合并
(1)设置 white-space: pre,禁用自动合并;
(2) 可选-》 consentText.replace(/
/g, '<br>')

  

原文地址:https://www.cnblogs.com/winyh/p/10382479.html