后台登录已经成功
This commit is contained in:
@@ -1,25 +1,40 @@
|
||||
<template>
|
||||
<a-config-provider :locale="zhCN">
|
||||
<router-view />
|
||||
<component :is="layout">
|
||||
<router-view />
|
||||
</component>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import zhCN from 'ant-design-vue/es/locale/zh_CN'
|
||||
import { onMounted } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import MainLayout from '@/layouts/MainLayout.vue'
|
||||
import zhCN from 'ant-design-vue/es/locale/zh_CN'
|
||||
|
||||
const route = useRoute()
|
||||
const appStore = useAppStore()
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化应用
|
||||
appStore.initialize()
|
||||
// 根据路由元信息确定使用的布局
|
||||
const layout = computed(() => {
|
||||
const layoutName = route.meta?.layout || 'default'
|
||||
|
||||
// 开发环境调试信息
|
||||
if (import.meta.env.DEV) {
|
||||
console.log('🎯 应用组件挂载完成')
|
||||
if (layoutName === 'main') {
|
||||
return MainLayout
|
||||
}
|
||||
|
||||
// 默认布局(如登录页)
|
||||
return 'div'
|
||||
})
|
||||
|
||||
// 初始化应用
|
||||
appStore.initialize()
|
||||
|
||||
// 开发环境调试信息
|
||||
if (import.meta.env.DEV) {
|
||||
console.log('🎯 应用组件挂载完成')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user