<template>
  <div id="app">
    <router-view />
    <div class="loading-container" v-show="isLoading">
      <cr-loading class="loading" size="24px">加载中...</cr-loading>
    </div>
    <login-modal />
    <auth-from-xyqb v-if="showAuthXyqb !== -1" />
    <net-error />
  </div>
</template>
<script>
import { mapState, mapActions } from "vuex";
import LoginModal from "@/components/LoginModal";
import AuthFromXyqb from "@/components/AuthFromXyqb";
import NetError from "@/components/NetError";
export default {
  components: {
    LoginModal,
    AuthFromXyqb,
    NetError
  },
  computed: {
    ...mapState(["isLoading", "showAuthXyqb"])
  },
  methods: {
    ...mapActions(["setIsLoading"])
  }
};
</script>
<style lang="less" scoped>
@import "./style/index.less";
.loading-container {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  .loading {
    padding: 6px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    @{deep} .cr-loading--text {
      color: #fff;
    }
  }
}
</style>
