Skip to content

Commit ac618bb

Browse files
author
zhuqingan.3
committed
fix: scrollview 滚动节流
1 parent 3f909cf commit ac618bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/taro-components/src/components/scroll-view/readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525
| Property | Attribute | Description | Type | Default |
2626
| --------------------------- | ---------------------------- | ----------- | ------------------------------------------- | ----------- |
2727
| `animated` | `scroll-with-animation` | | `boolean` | `false` |
28+
| `enhanced` | `enhanced` | | `boolean` | `false` |
2829
| `lowerThreshold` | `lower-threshold` | | `number \| string` | `50` |
2930
| `mpScrollIntoView` | `scroll-into-view` | | `string` | `undefined` |
3031
| `mpScrollIntoViewAlignment` | `scroll-into-view-alignment` | | `"center" \| "end" \| "nearest" \| "start"` | `undefined` |
3132
| `mpScrollLeft` | `scroll-left` | | `number \| string` | `undefined` |
3233
| `mpScrollTop` | `scroll-top` | | `number \| string` | `undefined` |
3334
| `scrollX` | `scroll-x` | | `boolean` | `false` |
3435
| `scrollY` | `scroll-y` | | `boolean` | `false` |
36+
| `showScrollbar` | `show-scrollbar` | | `boolean` | `true` |
3537
| `upperThreshold` | `upper-threshold` | | `number \| string` | `50` |
3638

3739

packages/taro-components/src/components/scroll-view/scroll-view.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Listen, Method, Prop, Watch, h } from '@stencil/core'
22
import classNames from 'classnames'
33

4-
import { debounce, handleStencilNodes } from '../../utils'
4+
import { throttle, handleStencilNodes } from '../../utils'
55

66
import type { ScrollViewContext } from '@tarojs/taro'
77

@@ -171,7 +171,7 @@ export class ScrollView implements ComponentInterface {
171171
})
172172
}
173173

174-
upperAndLower = debounce(() => {
174+
upperAndLower = throttle(() => {
175175
const {
176176
offsetWidth,
177177
offsetHeight,

0 commit comments

Comments
 (0)