imageBox_1.vue 834 Bytes
<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>