index.vue 1014 Bytes
<template>
  <div
    class="scrm-footer-panel"
    :style="{
      left: footerLeft + 'px',
      width: footerWidth + 'px'
    }"
  >
    <slot></slot>
  </div>
</template>
<script>
export default {
  name: 'glsx-footer',
  props: {
    className: {
      type: String,
      default: '.base-container-right'
    }
  },
  data() {
    return {
      footerLeft: 0,
      footerWidth: 0
    }
  },
  methods: {
    resize() {
      this.footerLeft = document.querySelector(this.className).offsetLeft
      this.footerWidth = document.documentElement.clientWidth - this.footerLeft
    }
  },
  destroyed() {
    window.removeEventListener('resize', this.resize)
  },
  mounted() {
    this.resize()
    window.addEventListener('resize', this.resize)
  }
}
</script>

<style lang="scss">
.scrm-footer-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 0px;
  height: 64px;
  background: #ffffff;
  box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>