product-item.vue 886 Bytes
<template>
  <div class="product-wrapper">
      <img :src="url" alt="" srcset="">
      <div class="price">{{price}}</div>
  </div>
</template>

<script>
export default {
  name: 'ProductItem',
  props: {
    pid:{
      type: String,
      default() {
        return '1212'
      }
    },
    url: {
      type: String,
      default() {
        return '//tvax2.sinaimg.cn/crop.0.0.828.828.50/006IPkwKly8fyhr791kkxj30n00n0q3u.jpg';
      }
    },
    price: {
      type: String,
      default() {
        return '¥121314';
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.product-wrapper {
  display: inline-block;
  position: relative;
  width: 100px;
  height: 100px;
}

.price {
  width: 100%;
  height: 28px;
  line-height: 28px;
  font-size: 20px;
  position: absolute;
  bottom: 0;
  text-align: center;
  background: rgba(0,0,0,0.50);
  color: white;
}


</style>