class Update extends React.Component{
constructor(props){
super(props);
this.state = {
nowtime:'2016-12-12 17:00:00',
resttime:'23'
};
}
render(){
return(
<p id="updateTime">
更新时间:{this.state.nowtime} 距离下一次更新大概还有{this.state.resttime}分钟
</p>
)
}
}
请教大家,如果我想每一分钟去更新一下nowtime和resttime,应该怎么写,谢谢了