fix: content和totalPages的某些组合会导致无限loading #81
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
fix #80
之前处理
content.length === 0 && totalPages === 0
这个组合时处理不当,导致无限loadingHow
梳理complete的逻辑判断。现在以下几个场景,data-list会判断状态为complete(无需再请求数据)
nextPage > totalPages || prevPage < defaultFirstPage
(data-list有默认的page边界判断,需要接口也遵守约定)Test
在项目中测试,首屏接口返回
![image](https://user-images.githubusercontent.com/19591950/67175763-f38cad80-f3f9-11e9-9976-d83dacf9777c.png)
content.length === 0 && totalPages === 0
时,能够正常显示没有数据的结果