<template>
  <div class="ad">
    <div class="banner" @click="linkTo">
      <img :src="data.imgUrl" alt="">
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: Object
  },
  data() {
    return {
    }
  },
  methods: {
    linkTo() {
      location.href = this.data.linkUrl;
    }
  },
}
</script>

<style lang="scss" scoped>
  .ad{
    .banner{
      position: relative;
      img{
        width: 100%;
      }
      &:after{
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 0.3rem;
        height: 0.18rem;
        background: url('../imgs/icon_adimg.png');
        background-position: center center;
        background-size: 100% 100%;
      }
    }
  }
</style>