代码 title: '直连网银\n单据直接驱动付款' <h1 className='title'>{title}</h1> 显示为 \n会被解析成空格 解决 给标签添加css样式属性即可 .title{ white-space: pre-wrap; }