安全解决将字符串" "转换成换行 给字符串的父标签添加下面样式 1 <span 2 v-if="item.content.action === 'CHAT'" 3 style="white-space: pre-wrap;"> 4 {{ text }} 5 </span>