【发布时间】:2019-09-17 04:26:36
【问题描述】:
我使用 API 与这段代码的 sn-p 反应:
constructor(props) {
super(props);
this.state = {
items: null
};
}
componentDidMount() {
return client
.get('/api/v1/product/list')
.then(response => {
this.setState({items: response});
return response
})
.catch(err => {
throw err
});
}
然后我从 API 得到这样的结果:
我的问题是,如何过滤 API 结果,然后使用 data..中的 results?
【问题讨论】:
-
我的问题被 2 票否决,顺便说一句,我的问题有什么问题..?如果我的问题有问题,我会对其进行编辑和改进。
标签: javascript reactjs api axios