第二十七轮: 三线直传(/v1/messages,/v1/responses)+删除路由别名;第二十八轮: element-plus 按需引入+死代码清理+前端支持格式列/API Key 文档
This commit is contained in:
1 parent
1b54802ad3
commit
4c1973b13d
28 files changed
+3016
-1263
No files matched your search
@@ -1,10 +1,16 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
// 第二十八轮:element-plus 改按需引入(vite.config.ts 的 Components/AutoImport 负责模板里的
|
||||
// <el-*>),这里不再 `import ElementPlus` + `app.use(ElementPlus)`、不再引全量 index.css。
|
||||
// 仍然手动引的只有三样:
|
||||
// ① 深色变量基座(A 皮肤用)—— 组件级样式依赖这三个 CSS 变量,必须全局在;
|
||||
// ② ElMessage 的样式(Dialogs 里命令式调用,模板里没 <el-message>,resolver 扫不到);
|
||||
// ③ ElMessageBox 的样式(同上,confirm() 弹窗)。
|
||||
// ElLoading / ElNotification 本项目未用,无需引(未来要用了记得补)。
|
||||
import 'element-plus/theme-chalk/dark/css-vars.css' // 深色变量基座(A 皮肤用)
|
||||
import 'element-plus/es/components/message/style/css'
|
||||
import 'element-plus/es/components/message-box/style/css'
|
||||
import 'highlight.js/styles/github.css'
|
||||
import * as ElementIcons from '@element-plus/icons-vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import { initTheme } from './lib/theme'
|
||||
@@ -15,9 +21,5 @@ initTheme() // mount 前应用主题(data-theme + dark class),避免闪色
|
||||
const app = createApp(App)
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(ElementPlus)
|
||||
app.use(i18n) // 多语言
|
||||
for (const [name, comp] of Object.entries(ElementIcons)) {
|
||||
app.component(name as string, comp as any)
|
||||
}
|
||||
app.mount('#app')
|
||||
Reference in new issue
Block a user