feat:Scroller add scrollTo method
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
import { Superview, View, IView, NativeViewModel } from '../ui/view'
|
||||
import { layoutConfig } from '../util/layoutconfig'
|
||||
import { BridgeContext } from '../runtime/global'
|
||||
|
||||
export function scroller(content: View, config?: IScroller) {
|
||||
return (new Scroller).also(v => {
|
||||
@@ -43,4 +44,8 @@ export class Scroller extends Superview implements IScroller {
|
||||
this.dirtyProps.content = this.content.viewId
|
||||
return super.toModel()
|
||||
}
|
||||
|
||||
scrollTo(context: BridgeContext, offset: { x: number, y: number }, animated?: boolean) {
|
||||
return this.nativeChannel(context, "scrollTo")({ offset, animated })
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user