omix - fix data.store undefined

This commit is contained in:
dntzhang 2019-03-01 15:02:08 +08:00
parent ecb462530a
commit 59222f8a3c
1 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/*!
* omix v1.0.0 by dntzhang
* omix v1.0.1 by dntzhang
* Github: https://github.com/Tencent/omi
* MIT Licensed.
*/
@ -182,11 +182,13 @@ function _update(kv) {
}
function updateStoreByFnProp(ele, data) {
let patch = {}
for (let key in data.store.__fnMapping) {
patch['store.' + key] = data.store.__fnMapping[key].call(data)
if(data.store){
let patch = {}
for (let key in data.store.__fnMapping) {
patch['store.' + key] = data.store.__fnMapping[key].call(data)
}
ele.setData(patch)
}
ele.setData(patch)
}