feat:scroller add onScroll and onScrollEnd property

This commit is contained in:
pengfei.zhou
2020-03-03 15:51:20 +08:00
committed by osborn
parent 0fa121e54f
commit 021fdab35f
16 changed files with 141 additions and 3 deletions

View File

@@ -35,6 +35,10 @@ export abstract class ViewModel<M extends Object, V extends ViewHolder> {
return this.state
}
getViewHolder() {
return this.viewHolder;
}
updateState(setter: Setter<M>) {
setter(this.state)
this.onBind(this.state, this.viewHolder)

View File

@@ -40,6 +40,12 @@ export class Scroller extends Superview implements IScroller {
@Property
contentOffset?: { x: number, y: number }
@Property
onScroll?: (offset: { x: number, y: number }) => void
@Property
onScrollEnd?: (offset: { x: number, y: number }) => void
allSubviews() {
return [this.content]
}