File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,17 @@ function resetList() {
50
50
</template>
51
51
```
52
52
53
+ ## Direction
54
+
55
+ Different scroll directions require different CSS style settings:
56
+
57
+ | Direction | Required CSS |
58
+ | ------------------ | ----------------------------------------------------- |
59
+ | ` bottom ` (default) | No special settings required |
60
+ | ` top ` | ` display: flex; ` <br >` flex-direction: column-reverse; ` |
61
+ | ` left ` | ` display: flex; ` <br >` flex-direction: row-reverse; ` |
62
+ | ` right ` | ` display: flex; ` |
63
+
53
64
::: warning
54
65
Make sure to indicate when there is no more content to load with ` canLoadMore ` , otherwise ` onLoadMore ` will trigger as long as there is space for more content.
55
66
:::
Original file line number Diff line number Diff line change @@ -198,8 +198,8 @@ export function useScroll(
198
198
directions . left = scrollLeft < internalX . value
199
199
directions . right = scrollLeft > internalX . value
200
200
201
- const left = ( scrollLeft * directionMultipler ) <= ( offset . left || 0 )
202
- const right = ( scrollLeft * directionMultipler )
201
+ const left = Math . abs ( scrollLeft * directionMultipler ) <= ( offset . left || 0 )
202
+ const right = Math . abs ( scrollLeft * directionMultipler )
203
203
+ el . clientWidth >= el . scrollWidth
204
204
- ( offset . right || 0 )
205
205
- ARRIVED_STATE_THRESHOLD_PIXELS
@@ -223,8 +223,8 @@ export function useScroll(
223
223
224
224
directions . top = scrollTop < internalY . value
225
225
directions . bottom = scrollTop > internalY . value
226
- const top = scrollTop <= ( offset . top || 0 )
227
- const bottom = scrollTop
226
+ const top = Math . abs ( scrollTop ) <= ( offset . top || 0 )
227
+ const bottom = Math . abs ( scrollTop )
228
228
+ el . clientHeight >= el . scrollHeight
229
229
- ( offset . bottom || 0 )
230
230
- ARRIVED_STATE_THRESHOLD_PIXELS
You can’t perform that action at this time.
0 commit comments