<template>
  <div id="app" class="dm-reset">
    <router-view />
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      isRouterAlive: true,
    };
  },
  mounted() {
    this.$store.commit('updateMainHeight', document.body.offsetHeight - 180);
  },
  watch: {
    '$route': {
      handler(val){
        // if(val.path.split('/')[1] !== 'compile' && this.$store.state.project !== 'compile' && this.$store.state.project && val.path.split('/')[1] !== this.$store.state.project) {
        //   // 切换应用 reload
        //   window.location.reload();
        // }
        if(val.path.split('/')[1]) {
          this.$store.commit('setProject', window.location.pathname.split('/')[2]);
        }
      },
      deep: true,
      immediate: true
    }
  }
};
</script>
