From 2dc5235d6366fe1b28d208388fb3423af6e54e4f Mon Sep 17 00:00:00 2001 From: zhongchengyi Date: Thu, 17 Jan 2019 10:44:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=AE=BE=E7=BD=AE=E4=BA=86td?= =?UTF-8?q?=20=E7=9A=84=E5=AE=BD=E5=BA=A6=EF=BC=8C=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=20flex-grow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wxParse/html2json.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wxParse/html2json.js b/wxParse/html2json.js index 6909559..358c65f 100755 --- a/wxParse/html2json.js +++ b/wxParse/html2json.js @@ -177,6 +177,17 @@ function html2json(html, bindName) { } } } + + // 处理 td + if (node.tag === 'td') { + // 如果有宽度,设置为 flex-grow + if (node.attr.width) { + node.attr.style.push('flex-grow'); + node.attr.style.push(parseInt(node.attr.width)); + if (!node.styleStr) node.styleStr = ''; + node.styleStr += 'flex-grow: ' + node.attr.width; + } + } //临时记录source资源 if(node.tag === 'source'){