add flow layout load more
This commit is contained in:
parent
a069cd7178
commit
5dea8b64e6
@ -43,7 +43,11 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
||||
private ignoreDirtyCallOnce = false
|
||||
|
||||
allSubviews() {
|
||||
return this.cachedViews.values()
|
||||
if (this.loadMoreView) {
|
||||
return [...this.cachedViews.values(), this.loadMoreView]
|
||||
} else {
|
||||
return this.cachedViews.values()
|
||||
}
|
||||
}
|
||||
|
||||
@Property
|
||||
@ -64,6 +68,15 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
||||
@Property
|
||||
batchCount = 15
|
||||
|
||||
@Property
|
||||
onLoadMore?: () => void
|
||||
|
||||
@Property
|
||||
loadMore?: boolean
|
||||
|
||||
@Property
|
||||
loadMoreView?: FlowLayoutItem
|
||||
|
||||
reset() {
|
||||
this.cachedViews.clear()
|
||||
this.itemCount = 0
|
||||
@ -91,6 +104,13 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
||||
return listItem.toModel()
|
||||
})
|
||||
}
|
||||
|
||||
toModel() {
|
||||
if (this.loadMoreView) {
|
||||
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||
}
|
||||
return super.toModel()
|
||||
}
|
||||
}
|
||||
|
||||
export function flowlayout(config: IFlowLayout) {
|
||||
|
Reference in New Issue
Block a user