提交 eb98d859 编写于 作者: E ester.zhou

update ts-container-refresh.md

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 99b35d38
# Refresh # Refresh
> **NOTE**<br/> The **\<Refresh>** component is a container that provides the pull-to-refresh feature.
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **<Refresh\>** component is used to refresh a page through a pull-down gesture. > **NOTE**
>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions ## Required Permissions
...@@ -19,11 +20,11 @@ Refresh\(value: \{refreshing: boolean, offset?: Length, friction?: number | stri ...@@ -19,11 +20,11 @@ Refresh\(value: \{refreshing: boolean, offset?: Length, friction?: number | stri
- Parameters - Parameters
| Name | Value Type | Mandatory | Default Value | Description | | Name| Value Type| Mandatory| Default Value| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| refreshing | boolean | Yes| - | Whether the current component is being refreshed. | | refreshing | boolean | Yes| - | Whether the current component is being refreshed.|
| offset | Length | No| 16 | Distance to the top of the parent component from the **<Refresh\>** component that comes to rest after a successful pull-down gesture. | | offset | Length | No| 16 | Distance to the top of the parent component from the **<Refresh\>** component that comes to rest after a successful pull-down gesture.|
| friction | number | No| 62 | Coefficient of friction, which indicates the **<Refresh\>** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100. <br/>- **0**: The **<Refresh\>** component is not sensitive to the pull-down gesture. <br/>- **100**: The **<Refresh\>** component is highly sensitive to the pull-down gesture. <br/>- Value greater than **100**: The **<Refresh\>** component is much more sensitive to the pull-down gesture. | | friction | number&nbsp;\|&nbsp;string | No| 62 | Coefficient of friction, which indicates the **<Refresh\>** component's sensitivity to the pull-down gesture. The value ranges from 0 to 100.<br>- **0** indicates that the **\<Refresh>** component is not sensitive to the pull-down gesture.<br>- **100** indicates that the **\<Refresh>** component is highly sensitive to the pull-down gesture.<br>- A larger value indicates a more sensitive response of the **\<Refresh>** component to the pull-down gesture.|
...@@ -32,23 +33,24 @@ Refresh\(value: \{refreshing: boolean, offset?: Length, friction?: number | stri ...@@ -32,23 +33,24 @@ Refresh\(value: \{refreshing: boolean, offset?: Length, friction?: number | stri
| Name| Description| | Name| Description|
| -------- | -------- | | -------- | -------- |
| onStateChange(callback: (state: RefreshStatus) => void)| Triggered when the refresh status changes. <br/>**state** indicates the refresh status. | | onStateChange(callback: (state: RefreshStatus) => void)| Triggered when the refresh status changes.<br>**state**: refresh status.|
| onRefreshing(callback: () => void)| Triggered when the component enters the refresh state. | | onRefreshing(callback: () => void)| Triggered when the component enters the refresh state.|
- RefreshStatus enums - RefreshStatus enums
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| Inactive | The component is not pulled down. This is the default value. | | Inactive | The component is not pulled down. This is the default value.|
| Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh. | | Drag | The component is being pulled down, but the pulled distance is shorter than the minimum length required to trigger the refresh.|
| OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh. | | OverDrag | The component is being pulled down, and the pulled distance exceeds the minimum length required to trigger the refresh.|
| Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state. | | Refresh | The pull-down ends, and the component rebounds to the minimum length required to trigger the refresh and enters the refresh state.|
| Done | The refresh is complete, and the component returns to the initial state (top). | | Done | The refresh is complete, and the component returns to the initial state (top).|
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct RefreshExample { struct RefreshExample {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册