直接把/n替换掉

const str = '\n你们好'

const newStr = str.replace(/\n/g, "<br/>")

br就能识别出来了

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐