<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <!-- <a-spin :spinning="false" :style="{height:'100%'}" > -->
      <keep-alive>

      <router-view />
      </keep-alive>
      <!-- </a-spin>s -->
    </div>
  </a-config-provider>
</template>

<script>
import { setDocumentTitle } from "@/common/utils/domUtil";
import { i18nRender } from "@/common/locales";
import storage from "store";
import { mapState } from "vuex";

export default {
  name: "App",
  mounted() {
    if (self != top) {
      //不是顶层页面
      window.top.location.href = window.location.href;
    } else {
      // window.top.location.href=window.location.href;
      //  console.log(window.location.href,'这里是顶层页面');
    }
    // console.log(this.$i18n.getLocaleMessage(this.$store.getters.lang))
    //  this.$store.dispatch('setLang', 'en-US')
    // console.log(storage.get('1234','4321'));
  },
  computed: {
    locale() {
      // sync dom title
      const { title } = this.$route.meta;
      // console.log(i18nRender(title))
      title && setDocumentTitle(`${i18nRender(title)} `);

      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale;
    },
    ...mapState({
      // 动态主路由
      isSpinning: (state) => state.homeUser.isSpinning,
    }),
  },
};
</script>
<style>
.ant-layout-footer {
  display: none;
}
.ant-layout-content {
  /* margin:  0 20px !important; */
  /* padding: 20px !important; */
  /* overflow-y: hidden !important; */
}
</style>
