-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
53 lines (45 loc) · 1.18 KB
/
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
46
47
48
49
50
51
52
53
import { createApp } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.js'
import { createRouter, createWebHashHistory } from 'https://unpkg.com/vue-router@4/dist/vue-router.esm-browser.js'
import VirtualList from 'https://unpkg.com/vue-virtual-list-v3@1.5.1/dist/index.js'
import PageIndex from './pages/index.js'
import PageBook from './pages/book.js'
import BookCoverAnimation from './components/book/book-cover-animation.js'
import { env } from './js/utils/env.js'
const routes = [
{
path: '/',
name: 'home',
component: PageIndex,
children: [
{
path: 'book/:server/:id',
name: 'transition',
component: BookCoverAnimation,
props: true,
children: [
{
path: 'read',
name: 'book',
component: PageBook,
props: true,
}
]
}
]
},
]
const router = createRouter({
history: createWebHashHistory(),
routes,
})
const App = {
template: '<router-view></router-view>',
}
const app = createApp(App)
app.config.unwrapInjectedRef = true
app.use(router)
app.use(VirtualList)
app.mount('#app')
if (!env.isInk()) {
document.body.classList.add('enable-anim')
}