<template>
  <div :style="windowSize">
    <back-nav v-show="showBackNav"></back-nav>
    <div :style="bodyStyle">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import store from '../../store'
export default {
  name: 'WindowSize',
  props: {
    showBackNav: {
      type: Boolean,
      default: true,
    },
    offset: {
      type: Number,
      default: 0,
    },
  },
  setup(props) {
    const windowSize = store.state.windowSize
    windowSize.height = windowSize.h - props.offset + 'px'
    const bodyStyle = {
      height: windowSize.h - props.offset - 45 + 'px',
      overflowY: 'auto',
    }
    return {
      windowSize,
      bodyStyle,
    }
  },
}
</script>