chore: update project files
This commit is contained in:
@@ -1,28 +1,40 @@
|
||||
<template>
|
||||
<div id="app" :data-route="route.name">
|
||||
<!-- 全屏背景层 -->
|
||||
<div class="fullscreen-background" :class="route.name"></div>
|
||||
|
||||
<!-- 导航栏 - 根据路由条件显示 -->
|
||||
<NavBar v-if="shouldShowNavBar" />
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<main :class="{ 'with-navbar': shouldShowNavBar }">
|
||||
<router-view />
|
||||
</main>
|
||||
|
||||
<!-- 页脚 - 根据路由条件显示 -->
|
||||
<Footer v-if="shouldShowFooter" />
|
||||
</div>
|
||||
<el-config-provider :locale="elementLocale">
|
||||
<div id="app" :data-route="route.name">
|
||||
<!-- 全屏背景层 -->
|
||||
<div class="fullscreen-background" :class="route.name"></div>
|
||||
|
||||
<!-- 导航栏 - 根据路由条件显示 -->
|
||||
<NavBar v-if="shouldShowNavBar" />
|
||||
|
||||
<!-- 主要内容区域 -->
|
||||
<main :class="{ 'with-navbar': shouldShowNavBar }">
|
||||
<router-view />
|
||||
</main>
|
||||
|
||||
<!-- 页脚 - 根据路由条件显示 -->
|
||||
<Footer v-if="shouldShowFooter" />
|
||||
</div>
|
||||
</el-config-provider>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
|
||||
import en from 'element-plus/dist/locale/en.mjs'
|
||||
import NavBar from '@/components/NavBar.vue'
|
||||
import Footer from '@/components/Footer.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const { locale } = useI18n()
|
||||
|
||||
// 动态计算 Element Plus 的语言配置
|
||||
const elementLocale = computed(() => {
|
||||
console.log('[App.vue] 当前语言切换为:', locale.value)
|
||||
return locale.value === 'zh' ? zhCn : en
|
||||
})
|
||||
|
||||
// 计算是否显示导航栏和页脚
|
||||
const shouldShowNavBar = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user