<template>
  <div class="office" @click="_toogle">
    <div class="btn">
      <div class="icon"></div>
    </div>
    <div class="title">文档</div>
    <div class="office-box" v-transfer-dom v-show="isShow">
      <keep-alive>
        <office-demo v-model="isShow" v-if="isShow"></office-demo>
      </keep-alive>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex';
const officeDemo = resolve => require(['./officeDemo'], resolve);
export default {
  name: 'suspension-office',
  components: {
    officeDemo
  },
  data() {
    return {
      isShow: false
    };
  },
  computed: {
    ...mapGetters({
      channelConfig: 'channelConfig'
    })
  },
  methods: {
    _toogle() {
      this.isShow = !this.isShow;
    }
  }
};
</script>
<style lang="less" scoped>
.office {
  width: 0.8rem;
  height: 0.8rem;
  .btn {
    position: relative;
    padding: 0 0.1rem;
    width: 0.8rem;
    height: 0.6rem;
    background: var(--suspension-office-bg) no-repeat center center;
    background-size: contain;
    .icon {
      width: 100%;
      height: 100%;
      background: url(./img/icon-office.png) no-repeat center center;
      background-size: auto 60%;
    }
  }
  .title {
    margin-top: 0.02rem;
    line-height: 0.18rem;
    text-align: center;
    white-space: nowrap;
    font-size: 0.16rem;
    color: #666;
  }
}
.office-box {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
}
</style>
