<template>
   <div id="app" v-loading="loading">
    <!-- <img src="./assets/logo.png"> -->
    <common-header v-if="showHeader"></common-header>
    <router-view :style="showHeader ? 'margin-top:60px;' : ''" />
  </div>
</template>

<script>
import commonHeader from '@/components/commonHeaders.vue'
export default {
    name: 'App',
    components:{
        commonHeader
    },
    data() {
        return {
            showHeader:false,
            loading: true
        }
    },
    watch:{
        $route: {
            handler: function(route) {
                // route.path === '/index' || route.path === '/weather'
                this.showHeader = route.path === '/login' ? false : true
            },
            immediate: true
        }
    },
    mounted() {
        window.workSpaceVo = {}
        this.loadPage()
    },
    methods:{
        loadPage() {
            setTimeout(() => {
                this.loading = false;
            }, 1000);
        }
    }
}
</script>

<style>
@import "./assets/css/main.css";
/* @import "./assets/css/color-dark.css"; */
#app{
    background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#373590), to(#373590), color-stop(0.2, #645fef),color-stop(0.8, #645fef));
}
</style>