31 lines
988 B
Vue
31 lines
988 B
Vue
|
|
<!-- =============================================================================
|
|||
|
|
// 企微IT智能服务台 — H5用户端根组件
|
|||
|
|
// =============================================================================
|
|||
|
|
// 说明:Vue3 应用的根组件,所有页面都渲染在这个组件内
|
|||
|
|
// 使用 Vant4 ConfigProvider 支持暗黑模式
|
|||
|
|
// ============================================================================= -->
|
|||
|
|
|
|||
|
|
<template>
|
|||
|
|
<!-- Vant4 主题配置:根据 themeStore 切换浅色/深色 -->
|
|||
|
|
<van-config-provider :theme="themeStore.currentTheme">
|
|||
|
|
<router-view />
|
|||
|
|
</van-config-provider>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script setup lang="ts">
|
|||
|
|
import { onMounted } from 'vue'
|
|||
|
|
import { useThemeStore } from '@/stores/theme'
|
|||
|
|
|
|||
|
|
/** 主题 Store */
|
|||
|
|
const themeStore = useThemeStore()
|
|||
|
|
|
|||
|
|
// 应用挂载时初始化主题(从 localStorage 读取偏好并应用)
|
|||
|
|
onMounted(() => {
|
|||
|
|
themeStore.initTheme()
|
|||
|
|
})
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<style>
|
|||
|
|
/* 根组件样式已在 global.css 中定义 */
|
|||
|
|
</style>
|