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
|
private ignoreDirtyCallOnce = false
|
||||||
|
|
||||||
allSubviews() {
|
allSubviews() {
|
||||||
return this.cachedViews.values()
|
if (this.loadMoreView) {
|
||||||
|
return [...this.cachedViews.values(), this.loadMoreView]
|
||||||
|
} else {
|
||||||
|
return this.cachedViews.values()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Property
|
@Property
|
||||||
@ -64,6 +68,15 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
|||||||
@Property
|
@Property
|
||||||
batchCount = 15
|
batchCount = 15
|
||||||
|
|
||||||
|
@Property
|
||||||
|
onLoadMore?: () => void
|
||||||
|
|
||||||
|
@Property
|
||||||
|
loadMore?: boolean
|
||||||
|
|
||||||
|
@Property
|
||||||
|
loadMoreView?: FlowLayoutItem
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.cachedViews.clear()
|
this.cachedViews.clear()
|
||||||
this.itemCount = 0
|
this.itemCount = 0
|
||||||
@ -91,6 +104,13 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
|||||||
return listItem.toModel()
|
return listItem.toModel()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toModel() {
|
||||||
|
if (this.loadMoreView) {
|
||||||
|
this.dirtyProps['loadMoreView'] = this.loadMoreView.viewId
|
||||||
|
}
|
||||||
|
return super.toModel()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function flowlayout(config: IFlowLayout) {
|
export function flowlayout(config: IFlowLayout) {
|
||||||
|
Reference in New Issue
Block a user