<template>
  <section class="app-main" :style="{ paddingTop: show ? '140px' : '80px' }">
    <div class="app-main-view">
      <keep-alive>
        <router-view v-if="$route.meta.isCache == 1" :key="$route.name" />
      </keep-alive>
      <router-view v-if="$route.meta.isCache != 1" :key="$route.name"/>
      <zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" zIndex="99" />
    </div>
  </section>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'AppMain',
  computed: {
    ...mapGetters(['show']),
    str() {
      return this.$store.state?.user?.name
    }
  }
}
</script>

<style scoped>
.app-main {
  /*50 = navbar  */
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.fixed-header + .app-main {
  /* padding-top: 50px; */
  /* padding-top: 80px; */
}
.app-main-view {
  width: 100%;
  height: 100%;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}
</style>
