-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
/
index.js
45 lines (36 loc) 路 983 Bytes
/
index.js
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
import { createApp } from 'vue'
import { createRouter, createWebHashHistory } from 'vue-router'
import App from './App'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { library } from '@fortawesome/fontawesome-svg-core'
import { fas } from '@fortawesome/free-solid-svg-icons'
import vuetify from './vuetify'
import '@mdi/font/css/materialdesignicons.css'
library.add(fas)
const component1 = {
template: `<div class="title">Page 1</div>`,
}
const component2 = {
template: `<div class="title">Page 2</div>`,
}
const router = createRouter({
history: createWebHashHistory(),
routes: [
{
path: '/page1',
name: 'Page 1',
component: component1,
},
{
path: '/page2',
name: 'Page 2',
component: component2,
},
{ path: '/:pathMatch(.*)*', redirect: '/page1' },
],
})
const app = createApp(App)
app.use(router)
app.use(vuetify)
app.component('FontAwesomeIcon', FontAwesomeIcon)
app.mount('#app')