问题
I have MUI v1 beta 32 running on a production site, very nicely. Time to update to v1! So far, changes have been very simple. It's mostly been a matter of updating the import tags.
But I am running into an issue with my selected <Tab/>
indicator.
I was using the rootInheritSelected
style override in order to apply the color of my choice.
How to implement it in v1?
回答1:
In the end I found it was much simpler:
<Tabs
textColor="inherit"
fullWidth
centered
classes={{
indicator: classes.indicator
}}>
<Tab />
<Tab />
</Tabs>
and the styles:
const styles = theme => ({
indicator: {
backgroundColor: 'white',
},
})
来源:https://stackoverflow.com/questions/50533704/how-to-implement-custom-tab-indicator-color-in-material-ui-v1