【发布时间】:2018-08-05 16:03:04
【问题描述】:
我想使用 yts API 以无限滚动的方式显示每 10 个数据。
它表明我可以通过此代码显示数据https://yts.am/api/v2/list_movies.json?sort_by=download_count&limit=10'
它的限制在 1 - 50 之间,但我想无限显示数据。似乎有页面参数..
你们知道如何无限显示数据吗?
这是 yts API 的链接 https://yts.am/api#list_movies
这是我的调用 API 代码
_getMovies = async()=>{
const movies = await this._callApi()
this.setState({
movies
})
}
_callApi=()=>{
return fetch('https://yts.am/api/v2/list_movies.json?sort_by=download_count&limit=10')
.then(potato=> potato.json())
.then(json=> json.data.movies)
.catch(err=>console.log(err))
}
【问题讨论】: