js: list add reload api

This commit is contained in:
pengfei.zhou
2022-08-16 17:44:03 +08:00
committed by osborn
parent 7dda15efbd
commit 3de2162ef6
12 changed files with 56 additions and 3 deletions

View File

@@ -54,6 +54,7 @@ export declare class List extends Superview {
*/
findCompletelyVisibleItems(context: BridgeContext): Promise<number[]>;
reset(): void;
reload(context: BridgeContext): Promise<void>;
private getItem;
private renderBunchedItems;
toModel(): NativeViewModel;

View File

@@ -71,6 +71,9 @@ export class List extends Superview {
this.cachedViews.clear();
this.itemCount = 0;
}
reload(context) {
return this.nativeChannel(context, 'reload')();
}
getItem(itemIdx) {
let view = this.renderItem(itemIdx);
view.superview = this;