diff --git a/README_EN.md b/README_EN.md index ec07bbaa9075771d362e9af7d9ab6f25e4ab7103..436523a896b1ada48637ed8077090d6cfbe76ef7 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, }) ```