dangerouslySetInnerHTML
export default function App () {
let init = () => {
// 向后端发送请求 拿到html 用富文本填展示
return `
<div>
<p>后端数据。。。。</p>
</div>
`
}
return (
<div>
{
<div dangerouslySetInnerHTML={{
__html: init()
}}></div>
}
</div>
)
}
标签:function,return,展示,default,React,文本
From: https://www.cnblogs.com/bingquan1/p/16819147.html