我有一个反应应用程序,其中 console.log 不显示其中的值,但显示消息。例如,
class Sample extends Component {
constructor() {
super()
this.handleSubmit = this.handleSubmit.bind(this);
this.state = {
msg:"Hi"
}}
handleSubmit(event) {
console.log("Message",this.state.msg);
}
render() {
return(
<div >
<RaisedButton label="Save" onClick={this.handleSubmit}/>
</div>
);
}}
Run Code Online (Sandbox Code Playgroud)
不仅是状态值,而且我给出的任何值都不会显示。会出现什么问题呢?请帮忙