shuimo-design / shuimo-ui

一款水墨风UI
https://shuimo.design
MIT License
285 stars 24 forks source link

todo:[Select] implement batch loading of request data or other bottoming out behaviors #47

Closed RSS1102 closed 1 year ago

RSS1102 commented 1 year ago

Requirement: Multiple fixed data requests can be made using the Select component.

Implementation:

  1. Expose a method called touchBottom that is triggered when it bottoms out - used to customize events for users when it bottoms out. (Optional)
  2. Expose an optional parameter touchBottomDistance - used to allow users to customize the bottom distance and include a default distance. (Optional)
higuaifan commented 1 year ago
  1. Use fetch to achieve the touchBottom requirement, and their logics are the same, but fetch feels more comfortable as the property name.
  2. touchBottomDistance doesn't seem to be necessary. The original intention is to trigger the loading state and request data when reaching the bottom. So, having the loading state triggered when reaching the bottom is sufficient.
  3. A needFetch prop is provided.

The overall solution is in the beta version for trial. Let's try it out first, and if there are any issues, we can discuss further🐶


  1. fetch来实现touchBottom的需求,并且他们的逻辑也是相同的,不过感觉fetch这个属性名更舒服点;
  2. touchBottomDistance感觉没什么需要的场景,本意就是触及底部后loading然后请求数据,那其实只要触底后loading状态就好了;
  3. 提供了一个needFetchprop;

整体方案是一个beta版本,先试用一下,有什么问题再讨论🐶