【问题标题】:Change style(color) Linear Progress Bar/ Material UI / Reactjs更改样式(颜色)线性进度条/材质 UI/Reactjs
【发布时间】:2020-09-03 16:57:49
【问题描述】:
 <LinearProgress style={{barColorPrimary: "red"}}" value={Number(campanha.Percentual)} />

如何更改栏的 barColorPrimary?我需要使用代码中的样式。

【问题讨论】:

    标签: javascript html reactjs material-ui


    【解决方案1】:

    我喜欢使用 withStyles() 高阶组件来注入自定义样式。

    在此处查看 LinearProgress 的示例:https://codesandbox.io/s/material-demo-forked-kwvb1?file=/demo.tsx(我们为条形颜色覆盖 barColorPrimary,为背景覆盖 colorPrimary)。

    更多关于在 Material UI 中自定义组件的信息可以在这里找到:https://material-ui.com/customization/components/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-14
      • 2019-09-26
      • 2020-02-05
      • 2021-12-26
      • 1970-01-01
      • 2018-07-29
      相关资源
      最近更新 更多