<template>
  <transition name="el-loading-fade" @after-leave="handleAfterLeave">
    <div
      v-show="visible"
      class="el-loading-mask"
      :style="{ backgroundColor: background || '' }"
      :class="[customClass, { 'is-fullscreen': fullscreen }]">
      <div class="loading">
        <img class="icon" src="/img/icon/loading1.gif" alt="极度证券">
      </div>
    </div>
  </transition>
</template>

<script>
  export default {
    data() {
      return {
        text: null,
        spinner: null,
        background: null,
        fullscreen: true,
        visible: false,
        customClass: ''
      };
    },

    methods: {
      handleAfterLeave() {
        this.$emit('after-leave');
      },
      setText(text) {
        // this.text = text || (this.$t && this.$t('common.l'));
      }
    }
  };
</script>
<style lang="less" scoped>
.el-loading-mask {
  z-index: 9999 !important;
}
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  .icon {
    width: 116px;
    display: block;
  }
}
</style>
