我想显示'立方'html实体(上标3).我这样做:
const formatArea = function(val){
return val + " ft³";
}
Run Code Online (Sandbox Code Playgroud)
其中formatArea正被从组件内部称为:
render(){
return (
<div>
{formatArea(this.props.area)}
</div>
);
}
Run Code Online (Sandbox Code Playgroud)
但是,浏览器显示为 ft³