diff --git a/packages/col/src/col.vue b/packages/col/src/col.vue index 8bf71f3e3..d6d7e6b09 100644 --- a/packages/col/src/col.vue +++ b/packages/col/src/col.vue @@ -29,9 +29,9 @@ }, style() { const padding = `${this.gutter / 2}px`; - return this.gutter ? - { paddingLeft: padding, paddingRight: padding } : - null; + return this.gutter + ? { paddingLeft: padding, paddingRight: padding } + : null; } } }; diff --git a/packages/image-preview/src/image-preview.vue b/packages/image-preview/src/image-preview.vue index f5aadeca1..3e80c3eeb 100644 --- a/packages/image-preview/src/image-preview.vue +++ b/packages/image-preview/src/image-preview.vue @@ -47,30 +47,30 @@ export default { * 根据屏幕自适应显示最长边 */ computeImageStyle() { - const previewSize = this.$refs.previewContainer.getBoundingClientRect(); - const img = new Image(); - const _this = this; + // const previewSize = this.$refs.previewContainer.getBoundingClientRect(); + // const img = new Image(); + // const _this = this; - img.onload = function() { - const imgRatio = parseFloat(this.width / this.height); - const previewRatio = parseFloat(previewSize.width / previewSize.height); + // img.onload = function() { + // const imgRatio = parseFloat(this.width / this.height); + // const previewRatio = parseFloat(previewSize.width / previewSize.height); - if (previewRatio <= imgRatio) { - const top = (previewSize.height - parseInt(previewSize.width / imgRatio, 10)) / 2; - _this.imageStyle = { - width: '100%', - height: 'auto', - top: top + 'px' - }; - } else if (previewRatio > imgRatio) { - _this.imageStyle = { - width: 'auto', - height: '100%' - }; - } - }; + // if (previewRatio <= imgRatio) { + // const top = (previewSize.height - parseInt(previewSize.width / imgRatio, 10)) / 2; + // _this.imageStyle = { + // width: '100%', + // height: 'auto', + // top: top + 'px' + // }; + // } else if (previewRatio > imgRatio) { + // _this.imageStyle = { + // width: 'auto', + // height: '100%' + // }; + // } + // }; - img.src = this.image; + // img.src = this.image; }, close() { diff --git a/packages/row/src/row.vue b/packages/row/src/row.vue index f72a027f4..72e468b42 100644 --- a/packages/row/src/row.vue +++ b/packages/row/src/row.vue @@ -20,9 +20,9 @@ style() { const gutter = Number(this.gutter); const margin = `-${gutter / 2}px`; - return gutter ? - { marginLeft: margin, marginRight: margin } : - {}; + return gutter + ? { marginLeft: margin, marginRight: margin } + : {}; } } };