2 回答

TA貢獻1951條經驗 獲得超3個贊
自定義函數方法如下:
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貢獻1802條經驗 獲得超4個贊
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 關注
- 1647 瀏覽
添加回答
舉報