显示UTF符号

Display UTF symbol

本文关键字:符号 UTF 显示      更新时间:2024-06-09

我想在React中的JSX中显示华氏度的符号。

到目前为止,我尝试了这个:

<h2 className="white-center">{Math.floor(JSON.parse(this.props.item["name"]["temperature"])[month]) + "&#8457"}</h2>

这个:

<h2 className="white-center">{Math.floor(JSON.parse(this.props.item["name"]["temperature"])[month])} &#8457</h2>

但是,没有工作,并且显示&#8457

如何显示UTF-8字符?

您缺少一个分号:&#8457;