<template>
  <div id="app" :class="mainClass">
    <div class='loader' v-if="isLoading">
        <div class='spinner-grow text-primary' role='status'>
          <span class='sr-only'>Loading...</span>
        </div>
      </div>
    <router-view/>
  </div>
</template>
<script>

export default {
  data(){
    return {
      isLoading:true
    }
  },
  computed:{
    /**
     * 授权页面添加特定类名
     * @returns {string}
     */
    mainClass(){
      const path = this.$route.path
      if(path.startsWith('/auth')){
        return 'login-page'
      }
    }
  },
  mounted(){
    this.isLoading = false
  }
}
</script>

<style>
#app {
  width: 100%;
  height:100%;
  min-height: 100vh;
}

</style>