-
-
Notifications
You must be signed in to change notification settings - Fork 157
/
Copy pathmain.ts
107 lines (97 loc) · 2.26 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import { createPinia } from 'pinia'
import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import { VueQueryPlugin } from '@tanstack/vue-query'
import { addCustomCommand } from '@vue/devtools-api'
import ElementPlus from 'element-plus'
import store from './stores/vuexStore'
import App from './App.vue'
import 'element-plus/dist/index.css'
import Home from './pages/Home.vue'
import Hey from './pages/Hey.vue'
import VueQuery from './pages/VueQuery.vue'
import VeeValidate from './pages/VeeValidate.vue'
import './style.css'
import 'uno.css'
const pinia = createPinia()
const app = createApp(App)
app.use(ElementPlus)
// devtools.connect()
// // @ts-expect-error skip type check
// window.VUE_DEVTOOLS_CONFIG = {
// openInEditorHost: 'http://localhost:3000',
// }
const routes: RouteRecordRaw[] = [
{
path: '/',
component: Home,
name: 'home',
alias: '/index',
},
{
path: '/hello',
component: () => import('./pages/Hello.vue'),
name: 'hello',
meta: { auth: 'admin', note: 'Hey! Manger' },
},
{
path: '/hey/:id',
component: Hey,
name: 'hey',
meta: { auth: 'user', note: 'Hey!' },
},
{
path: '/vue-query',
component: VueQuery,
name: 'vue-query',
},
{
path: '/vee-validate',
component: VeeValidate,
name: 'vee-validate',
},
{
path: '/circular-state',
component: () => import('./pages/CircularState.vue'),
name: 'circular-state',
},
{
path: '/interval-update',
component: () => import('./pages/IntervalUpdate.vue'),
name: 'interval-update',
},
{
path: '/inspect-custom-state',
component: () => import('./pages/InspectCustomState'),
name: 'inspect-custom-state',
},
]
const router = createRouter({
history: createWebHistory(),
routes,
})
app.use(VueQueryPlugin, {
enableDevtoolsV6Plugin: true,
})
app.use(router)
app.use(pinia)
app.use(store)
app.mount('#app')
setTimeout(() => {
addCustomCommand({
id: 'vueuse',
title: 'VueUse',
icon: 'https://vueuse.org/favicon.svg',
children: [
{
id: 'vueuse-docs',
title: 'Docs',
icon: 'auto-awesome',
action: {
type: 'url',
src: 'https://vueuse.org/',
},
},
],
})
}, 2000)