<template>
  <van-popup
    v-model="visible"
    :close-on-click-overlay="false"
    :lazy-render="false"
    :duration="0"
    :overlay-style="overlayStyle"
    class="loading-popup"
  >
    <div class="loading">
      <AudioWave class="loading__audio"></AudioWave>
    </div>
  </van-popup>
</template>

<script>
import AudioWave from './modules/AudioWave'

export default {
  name: 'Load',
  components: {
    AudioWave
  },
  props: {
    isShow: {
      type: Boolean,
      default: true
    },
    overlayStyle: {
      type: Object,
      default: () => ({ background: '#fff' })
    }
  },
  computed: {
    visible: {
      get: function() {
        return this.isShow
      },
      set: function(val) {
        this.$emit('changeVisible', val)
      }
    }
  }
}
</script>

<style lang="less" scoped>
.loading-popup {
  background: transparent;
}
.loading {
  background: transparent;
  height: 100px;
  justify-content: center;
  align-items: center;
  display: flex;
}
</style>
