js: declare scroll to item with top offset api
This commit is contained in:
4
doric-js/lib/src/widget/list.d.ts
vendored
4
doric-js/lib/src/widget/list.d.ts
vendored
@@ -54,8 +54,12 @@ export declare class List extends Superview {
|
||||
onDragging?: (from: number, to: number) => void;
|
||||
onDragged?: (from: number, to: number) => void;
|
||||
preloadItemCount?: number;
|
||||
/**
|
||||
* @param {number} config.topOffset - 目标位置cell的顶部偏移量
|
||||
*/
|
||||
scrollToItem(context: BridgeContext, index: number, config?: {
|
||||
animated?: boolean;
|
||||
topOffset?: number;
|
||||
}): Promise<any>;
|
||||
/**
|
||||
* @param context
|
||||
|
@@ -50,9 +50,13 @@ export class List extends Superview {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {number} config.topOffset - 目标位置cell的顶部偏移量
|
||||
*/
|
||||
scrollToItem(context, index, config) {
|
||||
const animated = config === null || config === void 0 ? void 0 : config.animated;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, });
|
||||
const topOffset = config === null || config === void 0 ? void 0 : config.topOffset;
|
||||
return this.nativeChannel(context, 'scrollToItem')({ index, animated, topOffset });
|
||||
}
|
||||
/**
|
||||
* @param context
|
||||
|
Reference in New Issue
Block a user