feat:scroller add scrollBy

This commit is contained in:
pengfei.zhou
2020-03-03 13:54:36 +08:00
committed by osborn
parent 6d7562877e
commit 0641f5e223
12 changed files with 73 additions and 8 deletions

View File

@@ -2016,6 +2016,9 @@ var Scroller = /** @class */ (function (_super) {
Scroller.prototype.scrollTo = function (context, offset, animated) {
return this.nativeChannel(context, "scrollTo")({ offset: offset, animated: animated });
};
Scroller.prototype.scrollBy = function (context, offset, animated) {
return this.nativeChannel(context, "scrollBy")({ offset: offset, animated: animated });
};
__decorate$7([
Property,
__metadata$7("design:type", Object)

View File

@@ -1496,6 +1496,9 @@ class Scroller extends Superview {
scrollTo(context, offset, animated) {
return this.nativeChannel(context, "scrollTo")({ offset, animated });
}
scrollBy(context, offset, animated) {
return this.nativeChannel(context, "scrollBy")({ offset, animated });
}
}
__decorate$7([
Property,

View File

@@ -2955,6 +2955,9 @@ class Scroller extends Superview {
scrollTo(context, offset, animated) {
return this.nativeChannel(context, "scrollTo")({ offset, animated });
}
scrollBy(context, offset, animated) {
return this.nativeChannel(context, "scrollBy")({ offset, animated });
}
}
__decorate$7([
Property,

4
doric-js/index.d.ts vendored
View File

@@ -591,6 +591,10 @@ declare module 'doric/lib/src/widget/scroller' {
x: number;
y: number;
}, animated?: boolean): Promise<any>;
scrollBy(context: BridgeContext, offset: {
x: number;
y: number;
}, animated?: boolean): Promise<any>;
}
}

View File

@@ -20,4 +20,8 @@ export declare class Scroller extends Superview implements IScroller {
x: number;
y: number;
}, animated?: boolean): Promise<any>;
scrollBy(context: BridgeContext, offset: {
x: number;
y: number;
}, animated?: boolean): Promise<any>;
}

View File

@@ -46,6 +46,9 @@ export class Scroller extends Superview {
scrollTo(context, offset, animated) {
return this.nativeChannel(context, "scrollTo")({ offset, animated });
}
scrollBy(context, offset, animated) {
return this.nativeChannel(context, "scrollBy")({ offset, animated });
}
}
__decorate([
Property,

View File

@@ -52,4 +52,8 @@ export class Scroller extends Superview implements IScroller {
scrollTo(context: BridgeContext, offset: { x: number, y: number }, animated?: boolean) {
return this.nativeChannel(context, "scrollTo")({ offset, animated })
}
scrollBy(context: BridgeContext, offset: { x: number, y: number }, animated?: boolean) {
return this.nativeChannel(context, "scrollBy")({ offset, animated })
}
}