【发布时间】:2018-01-18 18:08:53
【问题描述】:
所以我需要帮助,我想替换旧的单选按钮(经典) 使用 material-ui 的新版本。我做不到。 请提出解决方案。 提前谢谢。 在图片中你会看到一切
class Question extends Component {
render() {
var that = this; // Funny way to be able to access this from inside our iterator() function below.
var iterator = this.props.questionChoices.map(function(choice){
return (
<div className="radio">
<label>
<input type= {that.props.questionType} name={that.props.questionID} value={choice}/>
{choice}
</label>
<RadioButtonGroup >
<RadioButton
value="ludicrous"
label={choice}
valueSelected={choice}
style={styles.radioButton}
/>
</RadioButtonGroup>
</div>
);
});
return (
<div className="row">
<div className="form">
<Paper zDepth={1} >
<div className="h3">
<h3 >{this.props.questionID} - {this.props.questionText}</h3>
{iterator}
</div>
</Paper>
</div>
</div>
);
}
}
【问题讨论】:
-
对不起,我会把整个代码贴出来
-
var iterator = this.props.questionChoices.map(function(choice){ return (
标签: javascript reactjs material-ui