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

<script setup>
import store from '@/store'
import BackNav from "../back-nav/index.vue";

const props = defineProps({
  showBackNav: {
    type: Boolean,
    default: true,
  },
  showTitle: {
    type: Boolean,
    default: true
  },
  offset: {
    type: Number,
    default: 0,
  },
})

const screenSize = store.state.screenSize
screenSize.height = screenSize.h - props.offset + 'px'
const bodyStyle = {
  height: screenSize.h - props.offset - 45 + 'px',
  overflowY: 'auto',
}
</script>