Merge branch 'master' of code.aliyun.com:Doric/doric-js
This commit is contained in:
commit
919ec7aeb7
@ -194,11 +194,12 @@ export function jsObtainContext(id: string) {
|
|||||||
|
|
||||||
export function jsReleaseContext(id: string) {
|
export function jsReleaseContext(id: string) {
|
||||||
const context = gContexts.get(id)
|
const context = gContexts.get(id)
|
||||||
|
const args = arguments
|
||||||
if (context) {
|
if (context) {
|
||||||
timerInfos.forEach((v, k) => {
|
timerInfos.forEach((v, k) => {
|
||||||
if (v.context === context) {
|
if (v.context === context) {
|
||||||
if (global.nativeClearTimer === undefined) {
|
if (global.nativeClearTimer === undefined) {
|
||||||
return Reflect.apply(_clearTimeout, undefined, arguments)
|
return Reflect.apply(_clearTimeout, undefined, args)
|
||||||
}
|
}
|
||||||
timerInfos.delete(k)
|
timerInfos.delete(k)
|
||||||
nativeClearTimer(k)
|
nativeClearTimer(k)
|
||||||
|
@ -367,11 +367,13 @@ export abstract class Superview extends View {
|
|||||||
toModel() {
|
toModel() {
|
||||||
const subviews = []
|
const subviews = []
|
||||||
for (let v of this.allSubviews()) {
|
for (let v of this.allSubviews()) {
|
||||||
|
if (v != undefined) {
|
||||||
v.superview = this
|
v.superview = this
|
||||||
if (v.isDirty()) {
|
if (v.isDirty()) {
|
||||||
subviews.push(v.toModel())
|
subviews.push(v.toModel())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.dirtyProps.subviews = subviews
|
this.dirtyProps.subviews = subviews
|
||||||
return super.toModel()
|
return super.toModel()
|
||||||
}
|
}
|
||||||
|
@ -43,8 +43,12 @@ export class FlowLayout extends Superview implements IFlowLayout {
|
|||||||
private ignoreDirtyCallOnce = false
|
private ignoreDirtyCallOnce = false
|
||||||
|
|
||||||
allSubviews() {
|
allSubviews() {
|
||||||
|
if (this.loadMoreView) {
|
||||||
|
return [...this.cachedViews.values(), this.loadMoreView]
|
||||||
|
} else {
|
||||||
return this.cachedViews.values()
|
return this.cachedViews.values()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Property
|
@Property
|
||||||
columnCount = 2
|
columnCount = 2
|
||||||
@ -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