-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathmain.ts
52 lines (42 loc) · 1.15 KB
/
main.ts
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
import { createApp } from 'vue';
import { use } from 'echarts/core';
import VueGridLayout from 'vue-grid-layout';
// import ECharts modules manually to reduce bundle size
import { CanvasRenderer } from 'echarts/renderers';
import { BarChart, LineChart, PieChart } from 'echarts/charts';
import {
LegendComponent,
GridComponent,
TooltipComponent,
} from 'echarts/components';
import router from '@/router';
import store from '@/store';
import GlobalComponents from '@/plugins/global-components';
import { ErrorHandler } from '@/plugins/error-handler';
import '@/styles/app.scss';
import App from '@/App.vue';
use([
CanvasRenderer,
BarChart,
LineChart,
PieChart,
LegendComponent,
GridComponent,
TooltipComponent,
]);
async function main() {
// Start mock server
if (import.meta.env.DEV || import.meta.env.VITE_IS_VERCEL) {
const { worker } = await import('./mocks/index');
worker.start();
}
const app = createApp(App);
// 挂载插件
app.use(store);
app.use(router);
app.use(GlobalComponents);
app.use(VueGridLayout);
app.use(ErrorHandler);
app.mount('#app');
}
main();