办学质量监测教学评价系统
du
12 小时以前 58a5855774af8f66bdea6324d0b9a153065e5348
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import { createApp, watchEffect } from 'vue';
 
import { registerAccessDirective } from '@vben/access';
import { initTippy, registerLoadingDirective } from '@vben/common-ui';
import { MotionPlugin } from '@vben/plugins/motion';
import { preferences } from '@vben/preferences';
import { initStores } from '@vben/stores';
import '@vben/styles';
import '@vben/styles/antd';
 
import { useTitle } from '@vueuse/core';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'; // 样式文件
import { setupGlobalComponent } from '#/components/global';
import { $t, setupI18n } from '#/locales';
 
import { initComponentAdapter } from './adapter/component';
import App from './app.vue';
import { router } from './router';
import formCreate from '@form-create/element-ui';
import FcDesigner from '@form-create/designer';
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
async function bootstrap(namespace: string) {
 
  // 初始化组件适配器
  await initComponentAdapter();
 
  // // 设置弹窗的默认配置
  // setDefaultModalProps({
  //   fullscreenButton: false,
  // });
  // // 设置抽屉的默认配置
  // setDefaultDrawerProps({
  //   zIndex: 1020,
  // });
 
  const app = createApp(App);
 
  // 全局组件
  setupGlobalComponent(app);
  // 注册v-loading指令
  registerLoadingDirective(app, {
    loading: 'loading', // 在这里可以自定义指令名称,也可以明确提供false表示不注册这个指令
    spinning: 'spinning',
  });
 
  // 国际化 i18n 配置
  await setupI18n(app);
 
  // 配置 pinia-tore
  await initStores(app, { namespace });
 
  // 安装权限指令
  registerAccessDirective(app);
 
  // 初始化 tippy
  initTippy(app);
 
  // 配置路由及路由守卫
  app.use(router);
 
  // 配置Motion插件
  app.use(MotionPlugin);
  app.use(ElementPlus);
  app.use(formCreate);
  app.use(FcDesigner);
  app.use(Antd);
  // 动态更新标题
  watchEffect(() => {
    if (preferences.app.dynamicTitle) {
      const routeTitle = router.currentRoute.value.meta?.title;
      const pageTitle =
        (routeTitle ? `${$t(routeTitle)} - ` : '') + preferences.app.name;
      useTitle(pageTitle);
    }
  });
 
  app.mount('#app');
}
 
export { bootstrap };