product-group.vue 928 Bytes
<template>
  <div class="product-group">
    <ProductGroupItem
      v-for="(product, inx) in data"
      :share="share"
      :single="single"
      :product="product"
      :lazy="lazy"
      :key="inx"></ProductGroupItem>
  </div>
</template>

<script>
import ProductGroupItem from './product-group-item';
import {Button} from 'cube-ui';

export default {
  name: 'ProductGroup',
  props: {
    data: {
      type: Array,
      default() {
        return [];
      }
    },
    lazy: {
      type: Boolean,
      default: true
    },
    share: Boolean
  },
  computed: {
    single() {
      return this.data.length === 1;
    },
  },
  components: {Button, ProductGroupItem}
};
</script>

<style lang="scss" scoped>
.product-group {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  height: 276px;
  padding-top: 40px;
  padding-bottom: 40px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
</style>