From 89d6aafccd87ee16a293e64d8743c87fdb8a5c68 Mon Sep 17 00:00:00 2001 From: liangguirong Date: Fri, 13 Sep 2024 15:25:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=8B=B1=E6=96=87=E6=96=87?= =?UTF-8?q?=E6=A1=A3README=5FEN.md=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liangguirong --- README_EN.md | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/README_EN.md b/README_EN.md index ec07bba..436523a 100644 --- a/README_EN.md +++ b/README_EN.md @@ -28,37 +28,37 @@ import { PullToRefresh } from '@ohos/pulltorefresh' private scroller: Scroller = new Scroller(); PullToRefresh({ -// (Optional) Data source of the list component. -data: this.data, -// (Mandatory) List or grid component in the main layout. -scroller: this.scroller, -// (Mandatory) Custom list or grid view. -customList: () => { - // A UI method decorated by @Builder. - this.getListView(); -}, -// (Optional) Callback used to handle the pull-down refresh action. -onRefresh: () => { - return new Promise((resolve, reject) => { - // Simulate a network request operation. When data is obtained 2 seconds after the network request, inform the component to refresh the list data. - setTimeout(() => { - resolve ('Data refreshed'); - this.data = [...this.dataNumbers]; - }, 2000); - }); -}, -// (Optional) Callback used to handle the pull-up loading action. -onLoadMore: () => { - return new Promise((resolve, reject) => { - // Simulate a network request operation. When data is obtained 2 seconds after the network request, inform the component to update the list data. - setTimeout(() => { - resolve(''); - this.data.push ("Added items" + this.data.length); - }, 2000); - }); -}, -customLoad: null, -customRefresh: null, + // (Optional) Data source of the list component. + data: this.data, + // (Mandatory) List or grid component in the main layout. + scroller: this.scroller, + // (Mandatory) Custom list or grid view. + customList: () => { + // A UI method decorated by @Builder. + this.getListView(); + }, + // (Optional) Callback used to handle the pull-down refresh action. + onRefresh: () => { + return new Promise((resolve, reject) => { + // Simulate a network request operation. When data is obtained 2 seconds after the network request, inform the component to refresh the list data. + setTimeout(() => { + resolve ('Refresh successful'); + this.data = [...this.dataNumbers]; + }, 2000); + }); + }, + // (Optional) Callback used to handle the pull-up loading action. + onLoadMore: () => { + return new Promise((resolve, reject) => { + // Simulate a network request operation. When data is obtained 2 seconds after the network request, inform the component to update the list data. + setTimeout(() => { + resolve(''); + this.data.push ("Added items" + this.data.length); + }, 2000); + }); + }, + customLoad: null, + customRefresh: null, }) ``` -- Gitee