-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspa.html
53 lines (53 loc) · 1.67 KB
/
spa.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<title>SPA Router - The Merlin JS framework</title>
</head>
<body>
<nav>
<a href="#/">Home</a> |
<a href="#/hello/John">John</a> |
<a href="#/hello/Mary">Mary</a> |
<a href="#/counter/3">Counter 3</a> |
<a
href="#/todo?todos[]=read%20a%20book&todos[]=plant%20a%20tree"
>Todo</a> |
<a href="#/clock">Clock</a> |
<a href="#/wrong">Not Found</a> |
<a href="javascript:stop()">Stop router</a>
</nav>
<main>
<h1><img src="../favicon.ico"> SPA Router</h1>
<p>This is the home page!</p>
</main>
<template id="view-hello">
<h1>Hello <template text:="name"></template>!</h1>
</template>
<template id="view-404">
<h1>Page not found</h1>
</template>
<template id="view-counter">
<h1>Counter: <span text:="count"></span></h1>
<button onclick:="dec">-</button>
<button onclick:="inc">+</button>
</template>
<template id="view-todo">
<h1>To do list</h1>
<input type="text" value:="value" oninput:="NewValue">
<ul>
<li each:="todos" text:></li>
</ul>
<button onclick:="AddTodo">New!</button>
</template>
<template id="view-clock">
<h1>Clock</h1>
<h2 text:>00:00:00</h2>
</template>
<script type="module" src="spa.js"></script>
</body>
</html>