goodsItem_2.vue
1.06 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
<template>
<div class="goods-item-2-box" :class="'pid-' + pid" v-if="item" @click="jump(item)">
<div class="top-box">
<div class="img-box">
<img v-lazy="item.simg + SIGN.SMALL" class="simg" />
</div>
<slot name="flag"></slot>
</div>
<div class="content-box">
<div class="title" v-if="pid == undefined || pid == '1'">{{item.title}}</div>
<div class="price-box">
<div class="symbol">¥</div>
<div class="price">{{item.price}}</div>
</div>
<div class="ads" v-if="pid == '2'">
{{item.title || ""}}
</div>
</div>
</div>
</template>
<script>
export default {
data: function () {
return {
}
},
props: ["item", "pid"],
methods: {
/**
* 点击跳转
* @param {object} item [数据对象]
*/
jump(item) {
this.$emit("jump", item);
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang="less" scoped>
@import './goodsItem_2';
</style>