<template>
  <div class="common-banner" :style="{'height': height + 'px'}">
    <img class="bg-img" :src="img" :style="{'height': height + 'px', 'max-height': height + 'px'}" alt="" srcset="">
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    img: {
      type: String,
      default: ''
    },
    height: {
      type: Number,
      default: 521
    }
  },
  data() {
    return {
      // bannerImg: require('~/assets/images/products/product_banner.png')
    }
  }
}
</script>

<style lang="scss">
.common-banner {
  width: 100%;
  // height: 521px;
  position: relative;
  margin: 0 auto;
  overflow: hidden;
  text-align: center;
  .bg-img {
    position: absolute;
    top: 0px;
    left: 50%;
    bottom: 0px;
    right: 0px;
    z-index: 1;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    max-width: 2560px;
    // max-height: 521px;
    // height: 521px;
    display: block;
  }
}
</style>
