import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import CardTitle from './components/CardTitle.vue'
import { withFallbackImage } from './utils'
import './styles/scrollbar.css'
import './styles/elui.css'
import './styles/main.css'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册全局函数
app.config.globalProperties.$withFallbackImage = withFallbackImage
app.use(router)
app.use(ElementPlus)
app.component('CardTitle', CardTitle)
app.mount('#app')