2 回答

TA貢獻1848條經(jīng)驗 獲得超6個贊
在您的內(nèi)部使用一個<StepLabel>
組件,然后通過查看StepLabel CSS 文檔<Step>
來覆蓋樣式:
// Add this
import StepLabel from '@material-ui/core/StepLabel';
const useStyles = makeStyles((theme) => ({
? // your other stuff here
??
? // Add this
? step_label_root: {
? ? fontSize: '10px',
? }
}));
// within the component
<Step key={label} {...stepProps}>
? <StepButton
? ? onClick={handleStep(index)}
? ? completed={isStepComplete(index)}
? ? {...buttonProps}>
? ? <StepLabel classes={{ label: classes.step_label_root }}> // HERE add this
? ? ? {label}
? ? </StepLabel>
? </StepButton>
</Step>

TA貢獻1875條經(jīng)驗 獲得超5個贊
如果想在 material-ui 中更改樣式,您應該使用 withStyles。打字稿中的示例:
import {
createStyles,
Theme,
withStyles,
Step
} from "@material-ui/core";
const CustomStep = withStyles((theme: Theme) =>
createStyles({
// Input your style here
})
)(Step);
export default function Dashboard() {
return (....)
}
添加回答
舉報