imageBox_1.vue
834 Bytes
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
<template>
<div class="index-image-box" v-if="image">
<div class="ad-1" @click="toDetail(image.list[0])">
<img :src="image.img" mode="scaleToFill"/>
</div>
</div>
</template>
<script>
export default {
data() {
return {
}
},
props: ["image", "funcs"],
methods: {
/**
* 跳转详情页
* @param {object} goods [商品详情对象]
*/
toDetail(goods) {
if (typeof this.funcs === "object" && typeof this.funcs.toDetail === "function") {
this.funcs.toDetail(goods);
}
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less" scoped>
// @import './image_box';
.ad-1{
width: 100%;
// height: 210px;
// padding: 10px 0;
background-color: #fff;
img{
width: 100%;
height: 100%;
}
}
</style>