import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

// 1. 路由
import router from '@/router/index'
// 2. Pinia
import pinia from '@/store'
// 3. Element Plus
import ElementPlus from 'element-plus'
import 'normalize.css/normalize.css'
import 'element-plus/dist/index.css'
import './style/index.css'

// 其他 JS 库
import '@/js/lindex.js'
import '@/js/jquery.min.js'
import '@/js/webuploader.min.js'

// ECharts
import * as echarts from 'echarts'

// 字体
import './assets/fonts/fonts.css'

// 创建 App 实例
const app = createApp(App)

// 注册插件
app.use(router)
app.use(pinia)
app.use(ElementPlus)

// 设置全局属性
app.config.globalProperties.$echarts = echarts

// 挂载
app.mount('#app')

// 错误处理
app.config.errorHandler = function (err, vm, info) {
  console.error('Vue error:', err, info)
}