feat:add onScroll and onScrollEnd for list and flowlayout
This commit is contained in:
@@ -48,6 +48,10 @@ export interface IFlowLayout extends IView {
|
||||
onLoadMore?: () => void
|
||||
|
||||
loadMoreView?: FlowLayoutItem
|
||||
|
||||
onScroll?: (offset: { x: number, y: number }) => void
|
||||
|
||||
onScrollEnd?: (offset: { x: number, y: number }) => void
|
||||
}
|
||||
|
||||
export class FlowLayout extends Superview implements IFlowLayout {
|
||||
@@ -89,6 +93,12 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
||||
@Property
|
||||
loadMoreView?: FlowLayoutItem
|
||||
|
||||
@Property
|
||||
onScroll?: (offset: { x: number, y: number }) => void
|
||||
|
||||
@Property
|
||||
onScrollEnd?: (offset: { x: number, y: number }) => void
|
||||
|
||||
reset() {
|
||||
this.cachedViews.clear()
|
||||
this.itemCount = 0
|
||||
|
@@ -32,11 +32,20 @@ export class ListItem extends Stack implements IListItem {
|
||||
|
||||
export interface IList extends IView {
|
||||
renderItem: (index: number) => ListItem
|
||||
|
||||
itemCount: number
|
||||
|
||||
batchCount?: number
|
||||
|
||||
onLoadMore?: () => void
|
||||
|
||||
loadMore?: boolean
|
||||
|
||||
loadMoreView?: ListItem
|
||||
|
||||
onScroll?: (offset: { x: number, y: number }) => void
|
||||
|
||||
onScrollEnd?: (offset: { x: number, y: number }) => void
|
||||
}
|
||||
|
||||
export class List extends Superview implements IList {
|
||||
@@ -69,6 +78,12 @@ export class List extends Superview implements IList {
|
||||
@Property
|
||||
loadMoreView?: ListItem
|
||||
|
||||
@Property
|
||||
onScroll?: (offset: { x: number, y: number }) => void
|
||||
|
||||
@Property
|
||||
onScrollEnd?: (offset: { x: number, y: number }) => void
|
||||
|
||||
reset() {
|
||||
this.cachedViews.clear()
|
||||
this.itemCount = 0
|
||||
|
Reference in New Issue
Block a user