【发布时间】:2016-04-12 17:41:11
【问题描述】:
我想在 React 中的 JSX 中显示华氏符号。
到目前为止,我尝试过这个:
<h2 className="white-center">{Math.floor(JSON.parse(this.props.item["name"]["temperature"])[month]) + "℉"}</h2>
还有这个:
<h2 className="white-center">{Math.floor(JSON.parse(this.props.item["name"]["temperature"])[month])} ℉</h2>
但是,没有任何工作,并显示&#8457。
如何显示 UTF-8 字符?
【问题讨论】:
-
你试过直接
"\u2109"或"℉"吗?
标签: javascript utf-8 reactjs jsx