feat:adjust mvvm api

This commit is contained in:
pengfei.zhou
2019-10-25 14:13:35 +08:00
parent 81eb27843a
commit 182e6c9b74
4 changed files with 19 additions and 21 deletions

View File

@@ -230,6 +230,9 @@ export abstract class View implements Modeling {
block(this)
return this
}
in(group: Group) {
group.addChild(this)
}
}
export interface StackConfig extends LayoutConfig {

View File

@@ -44,6 +44,7 @@ export abstract class ViewModel<M extends Object, V extends ViewHolder<M>> {
attach(view: Group) {
this.viewHolder.build(view)
this.viewHolder.bind(this.state)
this.onAttached(this.state, this.viewHolder)
}
abstract onAttached(state: M, vh: V): void