我对反应还很陌生,我已经在这里呆了几个小时,但运气不佳。
我正在尝试设置选项卡的样式,因此下划线颜色为白色:
我怀疑这与覆盖 classes: 指标有关,但我不完全确定它是如何/为什么工作的。
为了清楚起见,我附上了我的代码。
import React, {Component} from "react"
import AppBar from "@material-ui/core/AppBar/AppBar";
import Tabs from "@material-ui/core/Tabs/Tabs";
import Tab from "@material-ui/core/Tab/Tab";
import withStyles from "@material-ui/core/es/styles/withStyles";
const styles = {
AppBar: {
background: 'transparent',
boxShadow: 'none'
},
Indicator:{
ripple:{
color: 'blue'
},
backgroundColor: 'white',
}
};
class NavBar extends Component {
render() {
return (
<AppBar style={styles.AppBar}>
<Tabs classes={{ indicator: styles.Indicator}} centered value={0}>
<Tab label="Fairness"/>
<Tab label="Community" />
<Tab label="Referrals" />
<Tab label="How To Play" /> …Run Code Online (Sandbox Code Playgroud)