-
-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathindex.html
34 lines (30 loc) · 857 Bytes
/
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
<html>
<body>
<script src="https://unpkg.com/vue@^2/dist/vue.js"></script>
<script src="https://unpkg.com/vue-router@^3/dist/vue-router.js"></script>
<div id="content"></div>
<script type="text/javascript">
const router = new VueRouter({
routes: [
{ path: '/home', component: { template: '<h1>Home</h1>' } },
{ path: '/about', component: { template: '<h1>About Us</h1>' } }
]
});
new Vue({
el: '#content',
router,
template: `
<div>
<div>
<router-link to="/home">Home</router-link>
<router-link to="/about">About Us</router-link>
</div>
<div id="route">
<router-view></router-view>
</div>
</div>
`
});
</script>
</body>
</html>