import { createApp } from 'vue'
import { createPinia } from 'pinia' // 引入 Pinia

import App from './App.vue'
import router from './router' // 引入路由配置
import ElementPlus from 'element-plus'//引入elmplus
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'  // 导入中文语言包
import * as ElIcons from '@element-plus/icons-vue'
import draggable from '@/utils/derective/draggable';


import './style.css'
import './styles/common.scss'
import './styles/element.scss'
const app = createApp(App)
const pinia = createPinia() // 创建实例
Object.keys(ElIcons).forEach((key) => {
  app.component(key, (ElIcons as Record<string, any>)[key])
})//ele icon
app.directive('draggable', draggable);
app.use(ElementPlus, { locale: zhCn })
app.use(pinia) // 使用 Pinia vue3 的状态管理 替代vuex
app.use(router) // 注册路由
app.mount('#app')
