鉴于Card
代码如here。如何更新卡片样式或任何材质 UI 样式:
const styles = theme => ({
card: {
minWidth: 275,
},
对此如下:
const styles = theme => ({
card: {
minWidth: 275, backgroundColor: props.color
},
当我尝试最新的一个时,我得到了
Line 15: 'props' is not defined no-undef
当我将代码更新为:
const styles = theme => (props) => ({
card: {
minWidth: 275, backgroundColor: props.color
},
also
const styles = (theme ,props) => ({
card: {
minWidth: 275, backgroundColor: props.color
},
代替
const styles = theme => ({
card: {
minWidth: 275, backgroundColor: props.color
},
我把网页上的组件卡样式搞乱了。
顺便说一下,我传递的 props 如下:
<SimpleCard backgroundColor="#f5f2ff" />
请帮忙!