state = {
data: {}
} componentWillMount () { this.getTask('10-24', 'A')
}#### getTask 方法 打印数据 ####
getTask = (id, bucked) => {
apis.getTask(id, bucked)
.then(data => console.log(data))
.catch(err => console.info(err))
}
getTask = (id, bucked) => {
apis.getTask(id, bucked)
.then(data => this.setState({data}))
.catch(err => console.info(err))
}
console.log(this.state.data)
慕虎7371278
浮云间
随时随地看视频慕课网APP
相关分类