import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import locale from "element-plus/es/locale/lang/zh-cn";
// import { baidu } from './utils/system/statistics'
import 'element-plus/theme-chalk/display.css' // 引入基于断点的隐藏类
import 'element-plus/dist/index.css'
import 'normalize.css' // css初始化
import './assets/style/common.scss' // 公共css
import './theme/modules/chinese/index.scss'
import App from './App.vue'
import store from './store'
import router from './router'
import { getAuthRoutes } from './router/permission'
// 引入自定义指令
import createPermissionDirective  from './directive/hasButton/index'
/* if (import.meta.env.MODE !== 'development') { // 非开发环境调用百度统计
  baidu()
} */

/** 权限路由处理主方法 */
getAuthRoutes().then(() => {
  const app = createApp(App)
  app.use(ElementPlus, { size: store.state.app.elementSize, locale: locale })
  app.use(store)
  app.use(router)
  app.directive('permission', createPermissionDirective(store))
  // app.config.performance = true
  app.mount('#app')
})

