<!--
 * @Description:: 请补充填写
 * @Version: 请配置版本号
 * @Author: 舟舟
 * @Date: 2022-06-25 22:32:24
 * @LastEditors: 舟舟
 * @LastEditTime: 2022-07-30 23:20:47
 * @FilePath: /ouicai_web_framework_vite_ep_nolang/src/App.vue
-->

<template>
    <el-config-provider :locale=local>
        <router-view></router-view>
    </el-config-provider>
</template>
<script setup lang="ts">
import { onMounted, watch,ref } from 'vue'
import iconfontInit from '/@/utils/iconfont'
import { useRoute } from 'vue-router'
import { setTitleFromRoute } from '/@/utils/common'
import { useConfig } from '/@/stores/config'
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'

const config = useConfig()
const route = useRoute()
const local = zhCn
onMounted(() => {
    iconfontInit()
    config.$state.layout.screenWidth = document.body.clientWidth;
})

watch(
    () => route.path,
    () => {
        setTitleFromRoute()
    }
)
</script>
