diff --git a/packages/wepy/src/component.js b/packages/wepy/src/component.js index e7c43361b..e68dae973 100644 --- a/packages/wepy/src/component.js +++ b/packages/wepy/src/component.js @@ -139,7 +139,11 @@ export default class { let bindfor = binded.for, binddata = $parent; bindfor.split('.').forEach(t => { - binddata = binddata[t]; + if (binddata[t]){ + binddata = binddata[t]; + }else{ + binddata = [{}]; + } }); repeatKey = Object.keys(binddata)[0]; @@ -270,7 +274,11 @@ export default class { if (typeof(binded) === 'object') { let bindfor = binded.for, binddata = $parent; bindfor.split('.').forEach(t => { - binddata = binddata[t]; + if (binddata[t]){ + binddata = binddata[t]; + }else{ + binddata = [{}]; + } }); val = binddata[index];