提交 d629b29f 编写于 作者: Q qiang

fix: merge network request for image

上级 946378ec
...@@ -4,11 +4,6 @@ ...@@ -4,11 +4,6 @@
ref="content" ref="content"
:style="style" :style="style"
/> />
<img
v-if="contentPath"
:src="contentPath"
:draggable="draggable"
>
<v-uni-resize-sensor <v-uni-resize-sensor
v-if="mode === 'widthFix' || mode === 'heightFix'" v-if="mode === 'widthFix' || mode === 'heightFix'"
ref="sensor" ref="sensor"
...@@ -128,6 +123,12 @@ export default { ...@@ -128,6 +123,12 @@ export default {
if (newValue === 'widthFix' || newValue === 'heightFix') { if (newValue === 'widthFix' || newValue === 'heightFix') {
this._fixSize() this._fixSize()
} }
},
contentPath (val) {
if (!val && this.__img) {
this.__img.remove()
delete this.__img
}
} }
}, },
mounted () { mounted () {
...@@ -177,6 +178,12 @@ export default { ...@@ -177,6 +178,12 @@ export default {
this._fixSize() this._fixSize()
this.contentPath = realImagePath this.contentPath = realImagePath
img.draggable = this.draggable
if (this.__img) {
this.__img.remove()
}
this.__img = img
this.$el.appendChild(img)
this.$trigger('load', $event, { this.$trigger('load', $event, {
width: img.width, width: img.width,
...@@ -224,12 +231,12 @@ uni-image[hidden] { ...@@ -224,12 +231,12 @@ uni-image[hidden] {
display: none; display: none;
} }
uni-image > div { uni-image>div {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
uni-image > img { uni-image>img {
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
...@@ -242,7 +249,7 @@ uni-image > img { ...@@ -242,7 +249,7 @@ uni-image > img {
opacity: 0; opacity: 0;
} }
uni-image > .uni-image-will-change { uni-image>.uni-image-will-change {
will-change: transform; will-change: transform;
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册