<!--
 * @Author: Jason Liu
 * @Date: 2022-03-10 09:45:34
 * @Desc:
-->
<template>
  <div id="app" :class="['app', appType]">
    <a-config-provider :locale="antLocale">
      <router-view v-if="isRouterAlive" />
    </a-config-provider>
  </div>
</template>
<script>

const antLane = {
  zh_CN: require("ant-design-vue/lib/locale-provider/zh_CN").default,
  en_US: require("ant-design-vue/lib/locale-provider/en_US").default,
  zh_HK: require("ant-design-vue/lib/locale-provider/zh_TW").default,
  pt_PT: require("ant-design-vue/lib/locale-provider/pt_PT").default,
  es_ES: require("ant-design-vue/lib/locale-provider/es_ES").default,
  vi_VN: require("ant-design-vue/lib/locale-provider/vi_VN").default
};

export default {
  name: "App",
  provide() {
    return {
      reload: this.reload,
    };
  },
  computed: {
    antLocale() {
      return antLane[$winexI18n.LanName]
    }
  },
  data() {
    return {
      themes: "winning_60",
      appType: undefined,
      isRouterAlive: true,
    };
  },
  created() {
    document.body.classList.add(this.themes);
  },
  mounted() {},
  methods: {
    /**
     * @descripttion: 页面重载
     * @return {*}
     */
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function () {
        this.isRouterAlive = true;
      });
    },
  },
};
</script>
