PullToRefresh
Drag down to reload
Pull down at the top of a list to reload it, the way phone apps do. It only works by touch, so also give a visible refresh button for everyone else.
Basic
- 第1話
- 第2話
- 第3話
- 第4話
- 第5話
- 第6話
Or drag down from the top of the list; past 64px the arrow flips — release to refresh.
@refreshgets adonecallback; call it when the reload has finished. "Refreshing" (refreshingLabel) is announced meanwhile.thresholdis how far to pull;scrollTargetis the container whose top counts, when it isn't the wrapper.
Usage
ts
import { BlessPullToRefresh } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
threshold | number | 64 | px of pull that triggers a refresh |
max | number | 96 | max visual travel |
disabled | boolean | — | |
scrollTarget | HTMLElement | null | — | scroll container to check; default = the wrapper itself, falling back to window |
refreshingLabel | string | "Refreshing" | announced while refreshing |
Events
| Name | Payload | Description |
|---|---|---|
refresh | [done: () => void] |
Slots
| Name | Scope | Description |
|---|---|---|
indicator | { ready: boolean; busy: boolean; pull: number; } | |
default | — |