feat: add preloadItemCount for List, incase we need preload more items before scroll to end

This commit is contained in:
pengfei.zhou
2023-03-09 10:55:32 +08:00
committed by jingpeng
parent 4103704162
commit 0774df96e1
26 changed files with 4495 additions and 2639 deletions

View File

@@ -88,8 +88,8 @@ export class List extends Superview {
* @param from
* @returns Returns the item of index which can dragged or not.
*/
@Property
itemCanDrag?: (from: number) => boolean
@Property
itemCanDrag?: (from: number) => boolean
/**
* @param from
@@ -104,6 +104,9 @@ export class List extends Superview {
@Property
onDragged?: (from: number, to: number) => void
@Property
preloadItemCount?: number
scrollToItem(context: BridgeContext, index: number, config?: { animated?: boolean, }) {
const animated = config?.animated
return this.nativeChannel(context, 'scrollToItem')({ index, animated, }) as Promise<any>