New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pagination 请求两次问题 #3128
Comments
当我们请求API的时候,例如API返回总数为456条,我们按照10条每页,一共有46页。当我们选了6之后的页数之后,然后把size选择成100条(目的就是让current * size > total),这个时候,分页就会同时触发size选择函数以及current选择函数。 |
|
这个要手动操作了。 更改pageSize之后。一般会把current重设为1然后重新拉取数据吧? |
使用函数防抖,再触发请求方法 |
handleSizeChange(val) {
this.currentPage = 1 // add this line, 切換頁面時將currentPage重置為1
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
}
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report(问题描述)
Steps to reproduce(问题复现步骤)
Screenshot or Gif(截图或动态图)
Link to minimal reproduction(最小可在线还原demo)
Other relevant information(格外信息)
The text was updated successfully, but these errors were encountered: