Showing
1 changed file
with
5 additions
and
1 deletions
| @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | @@ -10,7 +10,7 @@ export struct CustomPullToRefresh { | ||
| 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { | 10 | onLoadMore: (resolve?: (value: string | PromiseLike<string>) => void) => void = () => { |
| 11 | } | 11 | } |
| 12 | ///是否存在上拉更多 | 12 | ///是否存在上拉更多 |
| 13 | - @Prop hasMore: boolean = true | 13 | + @Prop @Watch('hasMoreChange') hasMore: boolean = true |
| 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); | 14 | refreshConfigurator: PullToRefreshConfigurator = new PullToRefreshConfigurator().setHasLoadMore(this.hasMore); |
| 15 | build() { | 15 | build() { |
| 16 | Column(){ | 16 | Column(){ |
| @@ -36,4 +36,8 @@ export struct CustomPullToRefresh { | @@ -36,4 +36,8 @@ export struct CustomPullToRefresh { | ||
| 36 | }) | 36 | }) |
| 37 | } | 37 | } |
| 38 | } | 38 | } |
| 39 | + | ||
| 40 | + hasMoreChange() { | ||
| 41 | + this.refreshConfigurator.setHasLoadMore(this.hasMore) | ||
| 42 | + } | ||
| 39 | } | 43 | } |
-
Please register or login to post a comment