【问题标题】:Material UI v5 Align Inline Typography Component to the rightMaterial UI v5 将内联排版组件向右对齐
【发布时间】:2022-02-07 15:50:55
【问题描述】:

我刚刚升级到 MUI 5.4 版,现在我的内联排版不再正确。

这是适用于 MUI 版本 4 的代码:

<Grid container xs={12}>
  <Grid container xs={12} justify="space-between" style={{borderBottom: "3px solid black"}}>
    <Typography inline>Value</Typography>
    <Typography inline align="right">{prodVol}MWh</Typography>
  </Grid>
</Grid>

我的猜测是,新网格存在问题,因为当我更改导入代码时,代码停止工作。

【问题讨论】:

  • 请查看answer
  • 太棒了。非常感谢:)

标签: reactjs material-ui typography text-align


【解决方案1】:

正如answer 中所述,我只是将“justify”替换为“justifyContent”。

我的 MUI V5 工作代码:

<Grid container xs={12}>
  <Grid container xs={12} justifyContent="space-between" style={{borderBottom: "3px solid black"}}>
    <Typography inline>Value</Typography>
    <Typography inline align="right">{prodVol}MWh</Typography>
  </Grid>
</Grid>

谢谢梅迪 :)

【讨论】:

    猜你喜欢
    • 2019-10-08
    • 1970-01-01
    • 2021-01-18
    • 2020-02-16
    • 2020-07-06
    • 1970-01-01
    • 2021-12-19
    • 1970-01-01
    • 2020-01-10
    相关资源
    最近更新 更多