yinbangzhong
2024-09-05 6b5f0408ab95f5ea135f97924c6e414042cd2a88
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
import { createApp } from 'vue';
import ArcoVue from '@arco-design/web-vue';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import globalComponents from '@/components';
import router from './router';
import store from './store';
import i18n from './locale';
import directive from './directive';
import './mock';
import App from './App.vue';
 
 
 
// Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details
// 样式通过 arco-plugin 插件导入。详见目录文件 config/plugin/arcoStyleImport.ts
// https://arco.design/docs/designlab/use-theme-package
import '@/assets/style/global.less';
import '@/api/interceptor';
 
const app = createApp(App);
 
app.use(ArcoVue, {});
app.use(ArcoVueIcon);
 
app.use(router);
app.use(store);
app.use(i18n);
app.use(globalComponents);
 
app.use(directive);
 
 
app.mount('#app');
 
// 添加全局方法
app.config.globalProperties.$messageSuccess = function (data) {
  this.$message.success(data)
};
app.config.globalProperties.$messageWarning = function (data) {
  this.$message.warning(data)
};
app.config.globalProperties.$messageError = function (data) {
  this.$message.error(data)
};
app.config.globalProperties.$messageInfo = function (data) {
  this.$message.info(data)
};
app.config.globalProperties.$messageNormal = function (data) {
  this.$message.normal(data)
};