Skip to content

Commit

Permalink
feat: image 组件在 H5 平台支持浏览器中的长按识别
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyucoding committed Jan 3, 2019
1 parent 8525739 commit 3171b58
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/view/components/image/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<uni-image v-on="$listeners">
<div :style="modeStyle" />
<img :src="realImagePath">
</uni-image>
</template>
<script>
Expand Down Expand Up @@ -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 = ''
Expand Down Expand Up @@ -149,6 +153,7 @@ export default {
height: 240px;
display: inline-block;
overflow: hidden;
position: relative;
}
uni-image[hidden] {
Expand All @@ -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 {
Expand Down

0 comments on commit 3171b58

Please sign in to comment.