<!--
 * @Author: YKH
 * @Date: 2021-12-08 10:29:23
 * @LastEditTime: 2022-06-24 10:32:30
 * @Description: 
 * @FilePath: \cool-admin\cool-admin-vue-vue3-ts-vite\src\App.vue
-->
<template>
	<el-config-provider :locale="locale">
		<div class="preload" v-if="loading">
			<div class="container">
				<p class="name">数据优化</p>
				<div class="loading"></div>
				<p class="title">正在加载菜单...</p>
				<p class="sub-title">初次加载资源可能需要较多时间 请耐心等待</p>
			</div>

			<div class="footer">
				<!-- <a href="http://ykhvip.fun" target="_blank"> http://ykhvip.fun </a> -->
				<a href="https://beian.miit.gov.cn" target="_blank"> 蜀ICP备2021031093号 </a>
			</div>
		</div>

		<router-view />
	</el-config-provider>
</template>

<script lang="ts">
import { computed, defineComponent } from "vue";
import { ElConfigProvider } from "element-plus";
import zhCn from "element-plus/lib/locale/lang/zh-cn";

import { useStore } from "vuex";

export default defineComponent({
	components: {
		[ElConfigProvider.name]: ElConfigProvider
	},

	setup() {
		const store = useStore();
		const locale = zhCn;
		const loading = computed(() => store.getters.appLoading);

		return {
			locale,
			loading
		};
	}
});
</script>

<style lang="scss" src="./assets/css/index.scss">
</style>

<style lang="scss" scoped>
.preload {
	position: fixed;
	left: 0;
	top: 0;
	height: 100%;
	width: 100%;
	z-index: 9999;
}
</style>
