提交 2673716c 编写于 作者: Q qiang

Merge branch 'fix-image' into dev

......@@ -10,7 +10,7 @@
@resize="_resize" />
</uni-image>
</template>
<script>
<script>
export default {
name: 'Image',
props: {
......@@ -122,8 +122,13 @@ export default {
},
_fixSize () {
const elWidth = this._getWidth()
if (elWidth) {
this.$el.style.height = elWidth / this.ratio + 'px'
if (elWidth) {
let height = elWidth / this.ratio
// fix: 解决 Chrome 浏览器上某些情况下导致 1px 缝隙的问题
if (typeof navigator && navigator.vendor === 'Google Inc.' && height > 10) {
height = Math.round(height / 2) * 2
}
this.$el.style.height = height + 'px'
this.sizeFixed = true
}
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册