feat: 前端配置和组件更新
- App.vue, Sidebar.vue - main.ts, router/index.ts - package.json, vite.config.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createApp, type Component } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
@@ -6,8 +6,18 @@ import router from './router'
|
||||
import './assets/styles/index.css'
|
||||
import App from './App.vue'
|
||||
|
||||
// 全局注册 Lucide 图标
|
||||
import * as iconModule from 'lucide-vue-next'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// 注册所有图标为全局组件(过滤非组件)
|
||||
for (const [name, icon] of Object.entries(iconModule)) {
|
||||
if (typeof icon === 'object' && icon !== null && 'render' in icon) {
|
||||
app.component(name, icon as Component)
|
||||
}
|
||||
}
|
||||
|
||||
app.use(createPinia())
|
||||
app.use(router)
|
||||
app.use(ElementPlus)
|
||||
|
||||
Reference in New Issue
Block a user