Component that adds Pull to refresh functionality to an <v-ons-page> component.
It can be used to perform a task when the user pulls down at the top of the page. A common usage is to refresh the data displayed in a page.
The VOnsPullHook component is used to add a pull to refresh functionality to a page. It can let the user refresh a page or load the latest data.
The VOnsPullHook component has three different states: initial, preaction and action. It starts in the initial state. When it’s pulled down below its height it will transition into the preaction state. If it’s released in initial state it will just bounce back. If it’s released in the preaction state, it will go into action state.
Every time the state changes the, a changestate event is fired.
Through the action prop it is possible to provide a handler that runs when the component reaches “action” state. This handler gets a done function as a parameter that must be called when the action is finished, thus returning to the initial state.
| Name | Description |
|---|---|
| changestate | Fired when the state is changed. The state can be either “initial”, “preaction” or “action”. |
| pull | Fired when the pull hook is pulled. |
Fired when the state is changed. The state can be either “initial”, “preaction” or “action”.
| Name | Type | Description |
|---|---|---|
| event | Object | Event object. |
| event.pullHook | Object | Component object. |
| event.state | String | Current state. |
Fired when the pull hook is pulled.
| Name | Type | Description |
|---|---|---|
| event | Object | Event object. |
| event.ratio | Object | The pulled distance ratio (scroll / height). |
| event.animationOptions | String | The animation options object. |
If you have any questions, use our Community Forum or talk to us on Discord chat. The Onsen UI team and your peers in the community will work together to help solve your issues.
For bug reports and feature requests use our GitHub Issues page.