From 7904ec6029ee8c18390826b34356a2f7220688af Mon Sep 17 00:00:00 2001 From: zz Date: Sat, 29 Dec 2018 10:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=9B=BE=E7=89=87=E8=B6=85=E5=87=BA?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E5=AE=BD=E5=BA=A6=E6=97=B6=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E8=AE=BE=E4=B8=BA100%=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E7=9A=84=E5=B1=8F=E5=B9=95=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/wxParseImg.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/wxParseImg.vue b/src/components/wxParseImg.vue index 6a52507..2ce67b9 100644 --- a/src/components/wxParseImg.vue +++ b/src/components/wxParseImg.vue @@ -45,7 +45,8 @@ export default { const { padding, mode } = this.node.attr; const { styleStr } = this.node; const imageHeightStyle = mode === 'widthFix' ? '' : `height: ${imageheight}px; !important`; - this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`; + // this.newStyleStr = `${styleStr}; ${imageHeightStyle}; width: ${imageWidth}px; padding: 0 ${+padding}px;`; + this.newStyleStr = `${styleStr ? styleStr : styleStr+';'}${imageHeightStyle}; width: ${imageWidth === '100%' ? imageWidth : imageWidth + 'px'}; padding: 0 ${+padding}px;`; }, // 计算视觉优先的图片宽高 wxAutoImageCal(originalWidth, originalHeight) { @@ -63,7 +64,8 @@ export default { // 判断按照那种方式进行缩放 if (originalWidth > windowWidth) { // 在图片width大于手机屏幕width时候 - results.imageWidth = windowWidth; + // results.imageWidth = windowWidth; + results.imageWidth = '100%'; results.imageheight = windowWidth * (originalHeight / originalWidth); } else { // 否则展示原来的数据