Merge pull request #438 from mingkang1993/patch-1

修复微信block载体在h5 下面出现宽度不是100%,增加绑定bindtap绑定bindclick事件
This commit is contained in:
当耐特 2019-09-20 16:05:28 +08:00 committed by GitHub
commit 32dc734f34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -18,10 +18,22 @@ function checkIsArray(json) {
let count = 0
if(!json.child) return false
for (let i = 0, len = json.child.length; i < len; i++) {
let tagName = json.child[i].tag
let tagItem = json.child[i];
let tagName = tagItem.tag;
let tagAttr = tagItem.attr;
if (tagName) {
if(tagAttr && tagAttr.bindtap){
tagAttr.bindclick = tagAttr.bindtap;
}
if (tagName === 'block') {
if (json.child[i].attr['wx:if'] || json.child[i].attr['wx:for']) {
if(tagAttr){
tagAttr.style = '{{{"width": "100%"}}}';
}
if (tagAttr['wx:if'] || tagAttr['wx:for']) {
count++
}
} else {