import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import './assets/styles/tailwind.css'

import '../types/global.d.ts'


// 自定义UI组件
import adminUIDesign from 'vue3-admin-ui'
import 'vue3-admin-ui/dist/style.css'

// 自定义样式
import '@/assets/styles/index.scss'

// 引入svg注册脚本
import 'virtual:svg-icons-register'

// 路由处理
import '@/permission'
import { perm } from '@/directive/index'

import App from './App.vue'
import router from './router'

const app = createApp(App)
app.directive('perm', perm)
app.use(adminUIDesign)
app.use(ElementPlus, { locale: zhCn, size: 'small', zIndex: 3000 })
app.use(createPinia().use(piniaPluginPersistedstate))
app.use(router)

app.mount('#app')
