/
tabbar.html
66 lines (62 loc) · 1.98 KB
/
tabbar.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, viewport-fit:cover" />
<link rel="stylesheet" href="/history-navigation-vue/lib/@1.5.0/dist/history-navigation-vue.min.css" />
<style>
html, body, .root{height: 100%;}
body {padding: 0; margin: 0; text-align: center; background-color: #ccc;}
.root{max-width: 798px; margin: 0 auto;}
a {cursor: pointer; color: #3eaf7c;}
a:active {background: #ccc;}
</style>
<title>TabBar - example - history-navigation-vue</title>
</head>
<body>
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js"></script>
<script src="/history-navigation-vue/lib/@1.5.0/dist/history-navigation-vue.min.js"></script>
<script type="text/x-template" id="index">
<div>
<h1>Hello World!</h1>
<p>Now: {{Date.now()}}</p>
<Navigator url="/detail">To Detail</Navigator>
</div>
</script>
<script type="text/x-template" id="detail">
<div>
<h1>Detail</h1>
<p>Now: {{Date.now()}}</p>
<Navigator type="back" style="font-size: 1.4em;">Back</Navigator>
<br>
<br>
<Navigator url="/me" type="switchTab">switchTab to Me</Navigator>
</div>
</script>
<script type="text/x-template" id="me">
<div>
<h1>Me</h1>
<p>Now: {{Date.now()}}</p>
</div>
</script>
<script>
window.Vue.use(window.historyNavigationVue.plugin, {
pages: [
{ path: '/', component: { template: '#index' } },
{ path: '/detail', component: { template: '#detail' } },
{ path: '/me', component: { template: '#me' } }
],
tabBar: {
list: [
{ pagePath: "/", text: "Home" },
{ pagePath: "/me", text: "Me" }
]
}
});
new window.Vue({
el: '#app',
template: '<NavigationController class="root" />'
});
</script>
</body>
</html>