PullRefresh
Pull to refresh: a gesture state machine pulling → loosing → loading → success, with distance math and the state machine fully consumed from @lh-ui/share/core/pull-refresh. The scroll carrier is a self-rendered scroll-view (refresher-enabled props; no manual gestures on this platform).
Platform differences (registered): uniapp/wxapp map scroll-view refresher events; alipay has no refresher and degrades to page-level
onPullDownRefresh(registered as page-level usage); web uses touch gestures.
Basic usage
vue
<template>
<lh-pull-refresh v-model="refreshing" :head-height="50" @refresh="onRefresh">
<view v-for="item in items" :key="item">Item {{ item }}</view>
</lh-pull-refresh>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const refreshing = ref(false)
const items = ref<number[]>([1, 2, 3])
function onRefresh() {
setTimeout(() => {
items.value = [1, 2, 3].map((i) => i + 3)
refreshing.value = false
}, 800)
}
</script>Custom head
The head named slot replaces the default text hint (scoped param { state }):
vue
<lh-pull-refresh v-model="refreshing">
<template #head="{ state }">
<text v-if="state === 'loading'">Loading…</text>
<text v-else>Pull to refresh</text>
</template>
<view>Content</view>
</lh-pull-refresh>Disabled
vue
<lh-pull-refresh :model-value="false" disabled />Props
| Name | Description | Type | Default |
|---|---|---|---|
| modelValue | Refreshing (controlled, v-model) | boolean | false |
| headHeight | Head height / trigger threshold px (maps refresher-threshold) | number | 50 |
| pullingText | Pulling hint (defaults to locale pullRefresh.pulling) | string | — |
| loosingText | Release hint (defaults to locale pullRefresh.loosing) | string | — |
| loadingText | Loading hint (defaults to locale pullRefresh.loading) | string | — |
| successText | Success hint (defaults to locale pullRefresh.success) | string | — |
| disabled | Disable pull (refresher-enabled=false) | boolean | false |
| customClass | Custom class (forwarded to the root node) | string | — |
| sx | Quick layout props | LhSxProps | — |
Events
| Event | Description | Payload |
|---|---|---|
| update:modelValue | Refreshing state change (write-back, v-model path) | value: boolean |
| refresh | Triggered at top: set modelValue=false after fetching | — |
Slots
| Name | Description |
|---|---|
| default | Page content |
| head | Custom head (scoped param { state }) |
Accessibility
The root node reflects loading via aria-busy.

