<script lang="ts" setup>
import { onMounted } from "vue";
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import { useRoute, useRouter } from 'vue-router'

const route = useRoute()
const router = useRouter()

// 路由初始化后执行
router.isReady().then(() => {
    // 如果访问地址无效则跳转到之前记录的应用或菜单，没有则跳到首页
    if(!router.hasRoute(route.name || '')) {
        router.replace('/404');
    }
})

onMounted(() => {
    
})
</script>

<template>
    <el-config-provider :locale="zhCn">
        <RouterView />
    </el-config-provider>
</template>
