2 回答
TA贡献1848条经验 获得超6个赞
在您的内部使用一个<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条经验 获得超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 (....)
}
添加回答
举报