mixPic.vue
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div>
<!--大图-->
<big-pic :item="data[0]" :showType="showType" :showTitle="showTitle" :isShowPrice="isShowPrice"
:siteUnitName="siteUnitName"></big-pic>
<!--小图-->
<ul class="goods-small-ul">
<template v-for="item in smallgoods">
<small-pic :item="item" :showType="showType" :showTitle="showTitle" :isShowPrice="isShowPrice"
:siteUnitName="siteUnitName"></small-pic>
</template>
</ul>
</div>
</template>
<style>
image[lazy=loading] {
width: 40px;
height: 300px;
margin: auto;
}
</style>
<script>
import smallPic from '../goods/smallPic.vue';
import bigPic from '../goods/bigPic.vue';
import Lazyload from 'mint-ui';
import {formatImg} from '../../utils/commonUtil';
export default {
props: {
data: '',
showType: '',
showTitle: '',
isShowPrice: '',
siteUnitName: ''
},
data() {
return {};
},
computed: {
imgsrc(){
return formatImg.formatSRC(this.data[0].image, 400, 400);
},
smallgoods(){
return this.data.slice(1);
},
},
components: {
smallPic,
bigPic
}
};
</script>