feat:add pureCallEntityMethod,avoid hook affects
This commit is contained in:
@@ -46,7 +46,7 @@ export class DoricListNode extends DoricSuperNode {
|
||||
onBlended() {
|
||||
super.onBlended()
|
||||
if (this.childNodes.length !== this.itemCount) {
|
||||
const ret = this.callJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount) as DVModel[]
|
||||
const ret = this.pureCallJSResponse("renderBunchedItems", this.childNodes.length, this.itemCount) as DVModel[]
|
||||
this.childNodes = this.childNodes.concat(ret.map(e => {
|
||||
const viewNode = DoricViewNode.create(this.context, e.type) as DoricListItemNode
|
||||
viewNode.viewId = e.id
|
||||
@@ -72,6 +72,9 @@ export class DoricListNode extends DoricSuperNode {
|
||||
if (this.loadMoreViewNode) {
|
||||
this.view.appendChild(this.loadMoreViewNode.view)
|
||||
}
|
||||
if (this.view.scrollTop + this.view.offsetHeight === this.view.scrollHeight) {
|
||||
this.onScrollToEnd()
|
||||
}
|
||||
}
|
||||
}
|
||||
blendSubNode(model: DVModel) {
|
||||
|
@@ -311,6 +311,14 @@ export abstract class DoricViewNode {
|
||||
}
|
||||
return Reflect.apply(this.context.invokeEntityMethod, this.context, argumentsList)
|
||||
}
|
||||
|
||||
pureCallJSResponse(funcId: string, ...args: any) {
|
||||
const argumentsList: any = ['__response__', this.getIdList(), funcId]
|
||||
for (let i = 1; i < arguments.length; i++) {
|
||||
argumentsList.push(arguments[i])
|
||||
}
|
||||
return Reflect.apply(this.context.pureInvokeEntityMethod, this.context, argumentsList)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user