Files
wecom_it_smart_desk/frontend-h5/src/App.vue
T

31 lines
988 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- =============================================================================
// 企微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>