【发布时间】:2020-09-03 16:57:49
【问题描述】:
<LinearProgress style={{barColorPrimary: "red"}}" value={Number(campanha.Percentual)} />
如何更改栏的 barColorPrimary?我需要使用代码中的样式。
【问题讨论】:
标签: javascript html reactjs material-ui
<LinearProgress style={{barColorPrimary: "red"}}" value={Number(campanha.Percentual)} />
如何更改栏的 barColorPrimary?我需要使用代码中的样式。
【问题讨论】:
标签: javascript html reactjs material-ui
我喜欢使用 withStyles() 高阶组件来注入自定义样式。
在此处查看 LinearProgress 的示例:https://codesandbox.io/s/material-demo-forked-kwvb1?file=/demo.tsx(我们为条形颜色覆盖 barColorPrimary,为背景覆盖 colorPrimary)。
更多关于在 Material UI 中自定义组件的信息可以在这里找到:https://material-ui.com/customization/components/
【讨论】: