Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 引导。使用react道具可以很好地改变颜色_Twitter Bootstrap_Reactjs - Fatal编程技术网

Twitter bootstrap 引导。使用react道具可以很好地改变颜色

Twitter bootstrap 引导。使用react道具可以很好地改变颜色,twitter-bootstrap,reactjs,Twitter Bootstrap,Reactjs,我正在使用bootstrap&reactjs。 我的页面上有一个.well组件。用户应该能够更改其颜色。颜色存储在{this.props.Color}中。 我正试图这样改变它: 在代码中使用了“this.props.color”,这是一个普通字符串。 应改为: style={{backgroundColor: this.props.color}} 顺便说一下,您最好将所有样式特性放在同一个对象中: <div className="well lead" style={{backgrou

我正在使用bootstrap&reactjs。 我的页面上有一个.well组件。用户应该能够更改其颜色。颜色存储在{this.props.Color}中。 我正试图这样改变它:

在代码中使用了“this.props.color”,这是一个普通字符串。 应改为:

style={{backgroundColor: this.props.color}}
顺便说一下,您最好将所有样式特性放在同一个对象中:

 <div className="well lead" style={{backgroundColor: this.props.color, marginTop:'20px'}} >

非常感谢。你的第二个通知很重要。我以前尝试过删除“{}”,但只有在将样式属性放在一个对象中时,它才起作用