<template>
  <div :class="appCss">
    <transition name="fade" mode="out-in">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
  import {mapGetters} from 'vuex'

  export default {
    name: 'AppMain',
    computed: {
      ...mapGetters([
        'device'
      ]),
      appCss () {
        if (this.device === 'mobile') {
          return 'app-main-mobile';
        }
        return 'app-main';
      }
    }
  }
</script>

<style scoped>
  .app-main {
    flex: auto;
    background-color: #f0f2f5;
  }

  .app-main-mobile {
    flex: auto;
    margin: 0;
  }
</style>
