Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让多行警报描述也包括 HTML(即<code>标签)
<code>
似乎描述被转义了,所以任何标记或按\n字面呈现,例如https://codepen.io/anon/pen/awzNzP?editors=001。
\n
好的,我想通了。我没有注意到该description属性可以是 a ReactNode,所以你可以这样做
description
ReactNode
descriptionElement = ( <code> Line 1 <br /> Line 2 </code> ) <Alert message='test' type='info' description={descriptionElement} />
运行版本