Authored by 陈峰

Merge branch 'hotfix/imagesize' into 'release/6.9.2'

fix image scale



See merge request !41
... ... @@ -24,23 +24,24 @@ export default {
};
},
itemSize() {
const {height: fHeight} = this.thumbSize;
const {width: fWidth, height: fHeight} = this.thumbSize;
const fScale = fWidth / fHeight;
const scale = this.data.width / this.data.height;
if (scale > 1) {
if (scale > fScale) {
return {
width: 750 / 40,
height: 750 / 40 / scale
width: fWidth,
height: fWidth / scale
};
} else if (scale < 1) {
} else if (scale < fScale) {
return {
width: fHeight * scale,
height: fHeight
};
} else {
return {
width: 750 / 40,
height: 750 / 40
width: fWidth,
height: fHeight
};
}
}
... ...
... ... @@ -4,7 +4,7 @@
<ArticleItemSlideImage v-if="data.blockList.length === 1" :lazy="false" :data="data.blockList[0]" :thumb-size="firstBlockSize"></ArticleItemSlideImage>
<Slide :key="`slide${data.articleId}`" v-else ref="slide" :data="data.blockList" :refresh-reset-current="false" :initial-index="slideIndex - 1" :threshold="0.2" :auto-play="false" :loop="false" :options="scrollOption" @change="onChange">
<SlideItem class="slide-item" :style="slideItemStyle" v-for="(item, inx) in data.blockList" :key="inx">
<ArticleItemSlideImage v-if="!thumb || inx === 0" :lazy="lazy && inx > 0" :data="item" :thumb-size="firstBlockSize"></ArticleItemSlideImage>
<ArticleItemSlideImage v-if="!thumb || inx === 0" :lazy="lazy || inx > 0" :data="item" :thumb-size="firstBlockSize"></ArticleItemSlideImage>
</SlideItem>
<template slot="dots" slot-scope="props">
<span class="slide-dot"
... ...