import { createApp } from 'vue'
import { initStore } from './store'
import { initRouter } from './router'
import App from './App.vue'

//ele
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import '@/styles/global.scss'

import vue3TreeOrg from 'vue3-tree-org';
import "vue3-tree-org/lib/vue3-tree-org.css";


import 'froala-editor/js/plugins.pkgd.min.js';
//Import third party plugins
import 'froala-editor/js/third_party/embedly.min';
import 'froala-editor/js/third_party/font_awesome.min';
import 'froala-editor/js/third_party/spell_checker.min';
import 'froala-editor/js/third_party/image_tui.min';
// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';
import 'froala-editor/css/froala_style.min.css';

import VueFroala from 'vue-froala-wysiwyg';

import {registerComponents} from "@/utils/registryComponents"

function setupApp() {
  const app = createApp(App)
  initStore(app)

  initRouter(app)
  
  // 注册全局组件
  registerComponents(app)

  app.use(ElementPlus,{locale: zhCn})
  app.use(vue3TreeOrg)
  app.use(VueFroala);
  app.mount('#app')
}

setupApp()