|
@@ -182,16 +182,24 @@
|
|
:key="indexI"
|
|
:key="indexI"
|
|
style="text-align: center"
|
|
style="text-align: center"
|
|
>
|
|
>
|
|
- <el-image
|
|
|
|
|
|
+ <img
|
|
|
|
+ @load="handleImageLoad($event, itemI)"
|
|
|
|
+ :style="{
|
|
|
|
+ width: itemI.width,
|
|
|
|
+ height: itemI.height,
|
|
|
|
+ }"
|
|
|
|
+ :src="itemI.src"
|
|
|
|
+ />
|
|
|
|
+ <!-- <el-image
|
|
:src="itemI.src"
|
|
:src="itemI.src"
|
|
fit="contain"
|
|
fit="contain"
|
|
:style="{
|
|
:style="{
|
|
- width: itemI.width + 'px',
|
|
|
|
- height: itemI.height + 'px',
|
|
|
|
|
|
+ width: itemI.width,
|
|
|
|
+ height: itemI.height,
|
|
}"
|
|
}"
|
|
:preview-src-list="[itemI.src]"
|
|
:preview-src-list="[itemI.src]"
|
|
@load="handleImageLoad($event, itemI)"
|
|
@load="handleImageLoad($event, itemI)"
|
|
- ></el-image>
|
|
|
|
|
|
+ ></el-image> -->
|
|
</figure>
|
|
</figure>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -731,16 +739,24 @@
|
|
:key="indexI"
|
|
:key="indexI"
|
|
style="text-align: center"
|
|
style="text-align: center"
|
|
>
|
|
>
|
|
- <el-image
|
|
|
|
|
|
+ <img
|
|
|
|
+ @load="handleImageLoad($event, itemI)"
|
|
|
|
+ :style="{
|
|
|
|
+ width: itemI.width,
|
|
|
|
+ height: itemI.height,
|
|
|
|
+ }"
|
|
|
|
+ :src="itemI.src"
|
|
|
|
+ />
|
|
|
|
+ <!-- <el-image
|
|
:src="itemI.src"
|
|
:src="itemI.src"
|
|
fit="contain"
|
|
fit="contain"
|
|
:style="{
|
|
:style="{
|
|
- width: itemI.width + 'px',
|
|
|
|
- height: itemI.height + 'px',
|
|
|
|
|
|
+ width: itemI.width,
|
|
|
|
+ height: itemI.height,
|
|
}"
|
|
}"
|
|
:preview-src-list="[itemI.src]"
|
|
:preview-src-list="[itemI.src]"
|
|
- @load="handleImageLoad($event, itemI)"
|
|
|
|
- ></el-image>
|
|
|
|
|
|
+
|
|
|
|
+ ></el-image> -->
|
|
</figure>
|
|
</figure>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -1773,12 +1789,17 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleImageLoad(event, item) {
|
|
handleImageLoad(event, item) {
|
|
- if (!item.width) {
|
|
|
|
- item.width = event.target.naturalWidth;
|
|
|
|
|
|
+ if (!item.width || item.width > 870) {
|
|
|
|
+ item.width =
|
|
|
|
+ event.target.naturalWidth > 870
|
|
|
|
+ ? 870 + "px"
|
|
|
|
+ : event.target.naturalWidth + "px";
|
|
}
|
|
}
|
|
if (!item.height) {
|
|
if (!item.height) {
|
|
- item.height = event.target.naturalHeight;
|
|
|
|
|
|
+ item.height =
|
|
|
|
+ item.width === "870px" ? "" : event.target.naturalHeight + "px";
|
|
}
|
|
}
|
|
|
|
+ this.$forceUpdate();
|
|
},
|
|
},
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -2205,6 +2226,9 @@ export default {
|
|
:deep .image img {
|
|
:deep .image img {
|
|
max-width: 100%;
|
|
max-width: 100%;
|
|
}
|
|
}
|
|
|
|
+:deep figure {
|
|
|
|
+ margin: 1em 0;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.item-page {
|
|
.item-page {
|