omip - fix this.update

This commit is contained in:
dntzhang 2019-02-28 16:24:07 +08:00
parent 3a761a350e
commit 27f8e413f6
1 changed files with 4 additions and 1 deletions

View File

@ -8,7 +8,10 @@ class Component {
update(patch) {
this.beforeUpdate && this.beforeUpdate()
this.beforeRender && this.beforeRender()
this._weappRef.setData(patch || this.data)
if (patch) {
this.data = Object.assign(this.data || {}, patch)
}
this._weappRef.setData(this.data)
this.updated && this.updated()
}