提交 3171b58f 编写于 作者: X xiaoyucoding

feat: image 组件在 H5 平台支持浏览器中的长按识别

上级 8525739c
<template>
<uni-image v-on="$listeners">
<div :style="modeStyle" />
<img :src="realImagePath">
</uni-image>
</template>
<script>
......@@ -32,6 +33,9 @@ export default {
ratio () {
return this.originalWidth && this.originalHeight ? this.originalWidth / this.originalHeight : 0
},
realImagePath () {
return this.$getRealPath(this.src)
},
modeStyle () {
let size = 'auto'
let position = ''
......@@ -149,6 +153,7 @@ export default {
height: 240px;
display: inline-block;
overflow: hidden;
position: relative;
}
uni-image[hidden] {
......@@ -165,6 +170,12 @@ export default {
-webkit-user-select: none;
-moz-user-select: none;
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
uni-image>.uni-image-will-change {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册