-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
41 lines (35 loc) · 916 Bytes
/
index.html
File metadata and controls
41 lines (35 loc) · 916 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>bind-js</title>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div id="template">
<input type="number" data-bind="a" />
<div>+</div>
<input type="number" data-bind="b" />
<div>=</div>
<div data-bind="result"></div>
<div data-bind="a"></div>
<div>+</div>
<div data-bind="b"></div>
<div>=</div>
<div data-bind="result"></div>
</div>
<script type="module">
import { bind } from "./bind.js";
const { proxy, destroy } = bind("template", {
a: 2,
b: 2,
result() {
return Number(this.a) + Number(this.b);
},
});
window.proxy = proxy;
window.destory = destroy;
</script>
</body>
</html>