- App.vue, Sidebar.vue - main.ts, router/index.ts - package.json, vite.config.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
674 B
TypeScript
26 lines
674 B
TypeScript
import { createApp, type Component } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import ElementPlus from 'element-plus'
|
|
import 'element-plus/dist/index.css'
|
|
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)
|
|
|
|
app.mount('#app')
|