feat:refact render child in groupNode
This commit is contained in:
@@ -70,7 +70,7 @@ export class List extends Superview implements IList {
|
||||
private renderBunchedItems(start: number, length: number) {
|
||||
return new Array(Math.min(length, this.itemCount - start)).fill(0).map((_, idx) => {
|
||||
const listItem = this.getItem(start + idx)
|
||||
return listItem.toModel()
|
||||
return listItem.viewId
|
||||
})
|
||||
}
|
||||
}
|
@@ -303,7 +303,7 @@ export abstract class Group extends Superview {
|
||||
set: (target, index, value) => {
|
||||
const ret = Reflect.set(target, index, value)
|
||||
// Let getDirty return true
|
||||
this.dirtyProps.children = []
|
||||
this.dirtyProps.children = this.children.map(e => e.viewId)
|
||||
return ret
|
||||
}
|
||||
})
|
||||
@@ -315,17 +315,5 @@ export abstract class Group extends Superview {
|
||||
addChild(view: View) {
|
||||
this.children.push(view)
|
||||
}
|
||||
|
||||
toModel() {
|
||||
this.dirtyProps.children = this.children.map(e => {
|
||||
if (e.isDirty()) {
|
||||
return e.toModel()
|
||||
} else {
|
||||
//Dont need return model
|
||||
return undefined
|
||||
}
|
||||
})
|
||||
return this.nativeViewModel
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user