-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.ts
55 lines (51 loc) · 1.02 KB
/
app.ts
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
// THIS IS A DEMO FILE
import {mk, n, a, t, e} from "./index"
const div = mk(
n(
"div",
n(
"button",
t("Button"),
a("id", "mybtn"),
e("click", (e)=>{
alert("Click!")
})
),
a("class", "mydiv"),
n("br"),
n(
"a",
a("href", "/index.js"),
t("See the small library!")
),
n("br")
),
n(
"p",
t("This is so small, minification only saved ~500 bytes.")
),
t("Basic Markup.")
);
document.body.append(div);
function App() {
return n(
"div",
n("br"),
n(
"button",
t("Button"),
e("click", ()=>{alert("Click")}),
e("mouseover", (e)=>{console.log(e)}),
),
n("br"),
n(
"a",
t("Home"),
a("href","/"),
)
);
}
const markup = mk(App());
document.body.append(markup);
new CustomEvent("k", {
});