# PullRefresh ### Install ```js import Vue from 'vue'; import { PullRefresh } from 'vant'; Vue.use(PullRefresh); ``` ## Usage ### Basic Usage The `refresh` event will be triggered when pull refresh, you should set `v-model` to `false` to reset loading status after process refresh event. ```html

Refresh Count: {{ count }}

``` ```js import { Toast } from 'vant'; export default { data() { return { count: 0, isLoading: false, }; }, methods: { onRefresh() { setTimeout(() => { Toast('Refresh Success'); this.isLoading = false; this.count++; }, 1000); }, }, }; ``` ### Success Tip Use `success-text` to set the success prompt after the refresh is successful ```html

Refresh Count: {{ count }}

``` ### Custom Tips Use slots to custom tips ```html

Refresh Count: {{ count }}

``` ## API ### Props | Attribute | Description | Type | Default | | --- | --- | --- | --- | | v-model | Loading status | _boolean_ | - | | pulling-text | Text to show when pulling | _string_ | `Pull to refresh...` | | loosing-text | Text to show when loosing | _string_ | `Loose to refresh...` | | loading-text | Text to show when loading | _string_ | `Loading...` | | success-text | Text to show when loading success | _string_ | - | | success-duration | Success text display duration(ms) | _number \| string_ | `500` | | animation-duration | Animation duration | _number \| string_ | `300` | | head-height `v2.4.2` | Height of head | _number \| string_ | `50` | | disabled | Whether to disable pull refresh | _boolean_ | `false` | ### Events | Event | Description | Parameters | | ------- | --------------------------- | ---------- | | refresh | Triggered when pull refresh | - | ### Slots | Name | Description | SlotProps | | ------- | ------------------------------------- | ------------ | | default | Default slot | - | | normal | Content of head when at normal status | - | | pulling | Content of head when at pulling | { distance } | | loosing | Content of head when at loosing | { distance } | | loading | Content of head when at loading | { distance } | | success | Content of head when succeed | - |