| 12345678910111213141516171819202122232425262728293031323334353637 |
- <script setup lang="ts">
- /**
- * App.vue —— 根组件(README §1.4 默认简体中文:el-config-provider 声明式 locale 注入)。
- *
- * 职责:
- * - el-config-provider 包住整个应用(声明式组件读中文 locale);
- * - 路由出口(router-view);
- * - 不持有业务状态(状态全部在 store,本组件零逻辑)。
- */
- /** locale 从 UMD 全局取(setup 顶层声明 → 模板可直接引用;globals.d.ts 已声明 ElementPlusLocaleZhCn) */
- const locale = ElementPlusLocaleZhCn;
- </script>
- <template>
- <!-- 声明式 locale 注入(README §1.4 双注入之一;命令式注入在 main.ts app.use 完成) -->
- <el-config-provider :locale="locale">
- <router-view />
- </el-config-provider>
- </template>
- <style>
- /* 全局基础样式(非 scoped;页面级局部样式留在各组件 <style scoped>) */
- * {
- box-sizing: border-box;
- }
- html,
- body {
- margin: 0;
- padding: 0;
- height: 100%;
- }
- #app {
- height: 100%;
- font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
- color: var(--app-text-primary);
- }
- </style>
|