文件名称:网络解析Httpery
文件大小:1KB
文件格式:JS
更新时间:2021-11-29 10:12:59
js constructor(props) { super(props); this.state = { arr: [] }; } componentDidMount() { //使用fetch用于网络加载数据 fetch( "http://api.shujuzhihui.cn/api/news/list?appKey=3e50f800ce7f4cdd9eda8d1c1ca71792&category;=娱乐" ) .then(response => response.json()) .then(responseJson => { this.setState({ arr: responseJson.RESULT.newsList }); }) .catch(error => { console.warn(error); }); } render() { return (