v-html中\n换行 问题:直接使用v-html会发现\n不会换行问题解决:加上style="white-space: pre-line" 示例: 123456<template> <div style="white-space: pre-line" v-html="htmlStr"></div></template><script setup>const htmlStr = ref('第一行\n\n'我是第二行)</script> 效果: 12第一行我是第二行