From fde27bf1ce488bf8a8c5e042c2ac47ef2b619fe7 Mon Sep 17 00:00:00 2001 From: Gcaufy Date: Wed, 15 Mar 2017 12:02:02 +0800 Subject: [PATCH] fixed 1.4.6 only first props bug --- packages/wepy-cli/src/compile-wpy.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/wepy-cli/src/compile-wpy.js b/packages/wepy-cli/src/compile-wpy.js index 6326b1de9..b553d024e 100644 --- a/packages/wepy-cli/src/compile-wpy.js +++ b/packages/wepy-cli/src/compile-wpy.js @@ -235,11 +235,10 @@ export default { let comid = util.getComId(elem); [].slice.call(elem.attributes || []).forEach((attr) => { if (attr.name !== 'id' && attr.name !== 'path') { - if (!props[comid]) { + if (!props[comid]) props[comid] = {}; - if (['hidden', 'wx:if', 'wx:elif', 'wx:else'].indexOf(attr.name) === -1) { - props[comid][attr.name] = attr.value; - } + if (['hidden', 'wx:if', 'wx:elif', 'wx:else'].indexOf(attr.name) === -1) { + props[comid][attr.name] = attr.value; } } });