我有
render() {
return <AppBar style={{ position: "fixed" }} title={<span>my Title</span>}
iconElementLeft={<IconButton><NavigationMenu /></IconButton>}
iconStyleRight={{color:"red"}}
iconElementRight={<IconButton><span className = "material-icons">account_circle</span></IconButton>}
/>
}
但 iconStyleRight 给了我错误
Type '{ [x: number]: undefined; color: any; }' is not assignable to type 'string'
不知道为什么。我尝试了很多组合,包括将 a 添加style
到<span>
元素中,这被忽略了。
希望正确的语法使这个正确的图标显示为红色,这样我就可以理解如何将样式应用于我的图标。