refactor(frontend): 统一 Element 语言注入并抽出全站皮肤
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a10ecc8073
commit
81d82a88d5
28 files changed
+144
-240
No files matched your search
@@ -1,21 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* features/admin/modules/wecom/WecomLayout.vue
|
||||
* 用途:企微管理壳层。注入共享数据,并提供 Element 语言与样式。
|
||||
* 依赖:useWecomAdmin、useElementProvider、element-plus、WECOM_ADMIN_KEY。
|
||||
* 用途:企微管理壳层。注入共享数据,并引入 Element 样式。
|
||||
* 依赖:useWecomAdmin、element-plus、WECOM_ADMIN_KEY。
|
||||
* 逻辑:路由 /admin/wecom 的父级。首屏等 loadAll 结束后再渲染子页。子页自己放页签和列表,解绑确认在 composable 里完成。
|
||||
*/
|
||||
import { onMounted, provide } from 'vue';
|
||||
import { ElConfigProvider, ElLoading } from 'element-plus';
|
||||
import { ElLoading } from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css';
|
||||
import '@/features/admin/styles/element-trial.css';
|
||||
import { useElementProvider } from '@/features/admin/composables/useElementProvider';
|
||||
import { useWecomAdmin } from './composables/useWecomAdmin';
|
||||
import { WECOM_ADMIN_KEY } from './wecom.context';
|
||||
|
||||
const vLoading = ElLoading.directive;
|
||||
const { elementLocale } = useElementProvider();
|
||||
const wecomAdmin = useWecomAdmin();
|
||||
const { isLoading } = wecomAdmin;
|
||||
provide(WECOM_ADMIN_KEY, wecomAdmin);
|
||||
@@ -26,11 +24,9 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ElConfigProvider :locale="elementLocale">
|
||||
<div v-loading="isLoading" class="wecom-layout">
|
||||
<router-view v-if="!isLoading" />
|
||||
</div>
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in new issue
Block a user