harmony 鸿蒙SwipeRefresher
SwipeRefresher
The swipe refresher is a component used to obtain and load content, typically with a pull-down gesture.
NOTE
This component and its child components are supported since API version 10. Updates will be marked with a superscript to indicate their earliest API version.
Modules to Import
import { SwipeRefresher } from '@kit.ArkUI';
Child Components
Not supported
Attributes
The universal attributes are not supported.
SwipeRefresher
SwipeRefresher ({content?: string, isLoading: boolean})
Decorator: @Component
Atomic service API: This API can be used in atomic services since API version 11.
System capability: SystemCapability.ArkUI.ArkUI.Full
Parameters
Name | Type | Mandatory | Decorator | Description |
---|---|---|---|---|
content | string | No | \@Prop | Text displayed when the content is loaded. The default value is an empty string. NOTE If the text is longer than the column width, it will be truncated. |
isLoading | boolean | If yes, | \@Prop | Whether content is being loaded. The value true means that content is being loaded, and false means the opposite. |
Events
The universal events are not supported.
Example
This example demonstrates how setting the content parameter to empty or non-empty strings and toggling the isLoading parameter between true and false affects the loading effect.
import { SwipeRefresher } from '@kit.ArkUI';
@Entry
@Component
struct Index {
build() {
Column() {
SwipeRefresher({
content: 'Loading',
isLoading: true
})
SwipeRefresher({
content: '',
isLoading: true
})
SwipeRefresher({
content: 'Loading',
isLoading: false
})
}
}
}
你可能感兴趣的鸿蒙文章
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦