0f95f62aa1
✨ 核心特性: - 实现模块化i18n架构,支持22个功能模块 - 完成中英双语翻译文件(44个翻译文件) - 新增懒加载翻译模块,提升性能 - 类型安全的翻译键值验证系统 🌐 国际化覆盖: - 所有主要页面(15+)完成国际化 - 导航侧边栏、顶栏、共享组件全部支持 - 仪表板统计组件完整国际化 - 登录页面及认证流程完整国际化 🎨 UI/UX 优化: - 统一顶栏按钮样式(语言切换+主题切换) - 移动端登录页采用全屏设计 - Logo组件智能换行支持中英文 - 响应式语言切换组件 📱 移动端适配: - 登录卡片移动端全屏布局 - 悬浮工具栏底部固定定位 - 触摸友好的交互设计 - 多设备响应式支持 🔧 技术改进: - 模块化翻译文件结构 (core/*, features/*) - 懒加载机制减少初始包体积 - TypeScript类型定义完整 - 翻译键值自动验证
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { createApp } from 'vue';
|
|
import { createPinia } from 'pinia';
|
|
import App from './App.vue';
|
|
import { router } from './router';
|
|
import vuetify from './plugins/vuetify';
|
|
import confirmPlugin from './plugins/confirmPlugin';
|
|
import { setupI18n } from './i18n/composables';
|
|
import '@/scss/style.scss';
|
|
import VueApexCharts from 'vue3-apexcharts';
|
|
|
|
import print from 'vue3-print-nb';
|
|
import { loader } from '@guolao/vue-monaco-editor'
|
|
import axios from 'axios';
|
|
|
|
// 初始化新的i18n系统,等待完成后再挂载应用
|
|
setupI18n().then(() => {
|
|
console.log('🌍 新i18n系统初始化完成');
|
|
|
|
const app = createApp(App);
|
|
app.use(router);
|
|
app.use(createPinia());
|
|
app.use(print);
|
|
app.use(VueApexCharts);
|
|
app.use(vuetify);
|
|
app.use(confirmPlugin);
|
|
app.mount('#app');
|
|
}).catch(error => {
|
|
console.error('❌ 新i18n系统初始化失败:', error);
|
|
|
|
// 即使i18n初始化失败,也要挂载应用(使用回退机制)
|
|
const app = createApp(App);
|
|
app.use(router);
|
|
app.use(createPinia());
|
|
app.use(print);
|
|
app.use(VueApexCharts);
|
|
app.use(vuetify);
|
|
app.use(confirmPlugin);
|
|
app.mount('#app');
|
|
});
|
|
|
|
|
|
axios.interceptors.request.use((config) => {
|
|
const token = localStorage.getItem('token');
|
|
if (token) {
|
|
config.headers['Authorization'] = `Bearer ${token}`;
|
|
}
|
|
return config;
|
|
});
|
|
|
|
loader.config({
|
|
paths: {
|
|
vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs',
|
|
},
|
|
}) |