-
Notifications
You must be signed in to change notification settings - Fork 677
/
Copy pathmain.ts
86 lines (76 loc) · 1.75 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
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
83
84
85
86
import './style.css';
// eslint-disable-next-line import/no-unresolved
import 'uno.css';
import '@/api/interceptor';
import 'katex/dist/katex.css';
import {
NButton,
NCheckbox,
NCheckboxGroup,
NDatePicker,
NForm,
NFormItem,
NInput,
NInputNumber,
NPopover,
NSelect,
NSpace,
NSwitch,
NTimePicker,
} from 'naive-ui';
import { createApp } from 'vue';
import App from './App.vue';
import { i18n } from './i18n';
import router from './router';
import pinia from './store';
// import * as Sentry from "@sentry/vue";
// import { BrowserTracing } from "@sentry/tracing";
const app = createApp(App);
// if (import.meta.env.VITE_ENABLE_SENTRY === "yes") {
// Sentry.init({
// app,
// dsn: import.meta.env.VITE_SENTRY_DSN || "",
// integrations: [
// new BrowserTracing({
// routingInstrumentation: Sentry.vueRouterInstrumentation(router),
// // tracePropagationTargets: ["localhost", "my-site-url.com", /^\//],
// }),
// ],
// tracesSampleRate: 1.0,
// ignoreErrors: ["AxiosError", "errors."]
// });
// }
app.use(router);
app.use(pinia);
app.use(i18n);
// app.use(hljs.vuePlugin);
// app.component('NForm', NForm);
// app.component('NFormItem', NFormItem);
// app.component('NInput', NInput);
// app.component('NInputNumber', NInputNumber);
// app.component('NSwitch', NSwitch);
// 注册部分naive-ui组件,以供vue-form使用
const naiveFormComponents = [
NForm,
NFormItem,
NInput,
NInputNumber,
NSwitch,
NButton,
NSelect,
NPopover,
NCheckbox,
NCheckboxGroup,
NSpace,
NDatePicker,
NTimePicker,
];
naiveFormComponents.forEach((component) => {
app.component(`N${component.name}`, component);
});
app.mount('#app');
declare global {
interface Window {
$message: any;
}
}