2 回答
TA贡献1817条经验 获得超14个赞
自定义函数方法如下:
showIntoCollapse(logListFirst) {
return (
<Collapse accordion onChange={(key) => this.onChange(key)}>
{
logListFirst.map((item) => {
const itemLogMemo = item.logMemo;
const itemGmtCreate = item.gmtCreate;
const itemUuid = item.logUuid;
const headerContent = itemLogMemo + ' --- ' + itemGmtCreate;
return (
<Panel header={headerContent} key={itemUuid}>
{this.state.itemList}
</Panel>
);
})
}
</Collapse>
)
}
TA贡献1887条经验 获得超5个赞
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>
)
}
- 2 回答
- 0 关注
- 557 浏览
添加回答
举报