-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
42 lines (33 loc) · 1.18 KB
/
index.html
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
<html>
<body>
<div id="app">
<router-view></router-view>
</div>
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/vue-router@4"></script>
<script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader"></script>
<script src="https://utupress.github.io/blocks/vue-load-module.js"></script>
<script>
// 2. Define some routes
// Each route should map to a component.
// We'll talk about nested routes later.
const routes = [
{ path: '/', component: fetchPage('website.vue') },
{ path: '/about', component: fetchPage('website.vue') },
]
// 3. Create the router instance and pass the `routes` option
// You can pass in additional options here, but let's
// keep it simple for now.
const router = VueRouter.createRouter({
// 4. Provide the history implementation to use. We are using the hash history for simplicity here.
history: VueRouter.createWebHistory('/'),
//history: VueRouter.createWebHashHistory(),
mode: 'history',
routes, // short for `routes: routes`
})
const app = Vue.createApp({});
app.use(router)
app.mount('#app');
</script>
</body>
</html>