我正在使用 Material UI 选项卡 v0.20.0 以表格格式显示内容。选项卡采用全宽。我附上了预期和当前输出的屏幕截图。
Expected output
Current Output
请让我知道同样的解决方案。
如果您想要固定宽度的选项卡,则需要覆盖root
css 类传递给Tab
组件,您必须在其中重写minWidth
and width
属性。
Example:
const Component = ({ classes }) => (
<Tabs value={0}>
<Tab classes={{ root: classes.tab }} label="One" />
<Tab classes={{ root: classes.tab }} label="Two" />
</Tabs>
);
// this is injected as classes prop into the wrapping component
const styles = {
tab: {
minWidth: 200, // a number of your choice
width: 200, // a number of your choice
}
};
export default withStyles(styles)(Component);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)