|
|
<template>
|
|
|
<div class="product-wrapper">
|
|
|
<img :src="url" alt="" srcset="">
|
|
|
<div class="product-wrapper" @click="onclick">
|
|
|
<img class="image-cls" :src="url" alt="" srcset="">
|
|
|
<div class="price">{{price}}</div>
|
|
|
</div>
|
|
|
</template>
|
...
|
...
|
@@ -9,10 +9,10 @@ |
|
|
export default {
|
|
|
name: 'ProductItem',
|
|
|
props: {
|
|
|
pid:{
|
|
|
pid: {
|
|
|
type: String,
|
|
|
default() {
|
|
|
return '1212'
|
|
|
return '1212';
|
|
|
}
|
|
|
},
|
|
|
url: {
|
...
|
...
|
@@ -27,8 +27,13 @@ export default { |
|
|
return '¥121314';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
onclick() {
|
|
|
console.log('click product')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
...
|
...
|
@@ -39,6 +44,11 @@ export default { |
|
|
height: 100px;
|
|
|
}
|
|
|
|
|
|
.image-cls {
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
|
}
|
|
|
|
|
|
.price {
|
|
|
width: 100%;
|
|
|
height: 28px;
|
...
|
...
|
@@ -47,7 +57,7 @@ export default { |
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
text-align: center;
|
|
|
background: rgba(0,0,0,0.50);
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
color: white;
|
|
|
}
|
|
|
|
...
|
...
|
|