feat:Scroller add scrollTo method
This commit is contained in:
5
doric-js/lib/src/widget/scroller.d.ts
vendored
5
doric-js/lib/src/widget/scroller.d.ts
vendored
@@ -1,4 +1,5 @@
|
||||
import { Superview, View, IView, NativeViewModel } from '../ui/view';
|
||||
import { BridgeContext } from '../runtime/global';
|
||||
export declare function scroller(content: View, config?: IScroller): Scroller;
|
||||
export interface IScroller extends IView {
|
||||
content?: View;
|
||||
@@ -7,4 +8,8 @@ export declare class Scroller extends Superview implements IScroller {
|
||||
content: View;
|
||||
allSubviews(): View[];
|
||||
toModel(): NativeViewModel;
|
||||
scrollTo(context: BridgeContext, offset: {
|
||||
x: number;
|
||||
y: number;
|
||||
}, animated?: boolean): Promise<any>;
|
||||
}
|
||||
|
@@ -34,4 +34,7 @@ export class Scroller extends Superview {
|
||||
this.dirtyProps.content = this.content.viewId;
|
||||
return super.toModel();
|
||||
}
|
||||
scrollTo(context, offset, animated) {
|
||||
return this.nativeChannel(context, "scrollTo")({ offset, animated });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user