-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
71 lines (63 loc) · 1.53 KB
/
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
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
67
68
69
70
71
<!DOCTYPE html>
<html>
<head>
<script src="retro.js"></script>
</head>
<body>
<retro-component text="Can do this too" description="Very nice">
<style scoped>
ul {
margin: 0px;
padding: 0px;
}
ul li {
margin: 0px;
padding: 0px;
list-style-type: none;
}
ul li button {
background: black;
color: white;
padding: 10px;
margin: 2px;
border-radius: 3px;
font-family: sans-serif;
font-size: 14px;
font-weight: 500;
}
</style>
<h1>{{section}} {{heading}}</h1>
<h2>Leave this untouched</h2>
<button r:click="update()">Update</button>
</retro-component>
<script>
class RetroComponent extends Retro {
constructor() {
super()
}
setInitialState() {
return {
section: "1.",
heading: "Heading number one",
description: "This is some paragraph text",
}
}
ready() {
console.log('Ready')
}
propsUpdate(props) {
console.log('Updated component props: ', props)
}
update() {
this.updateState({
section: "2.",
heading: "Heading number two",
description: "This is some more paragraph text",
})
}
}
// Initialize the app
customElements.define('retro-component', RetroComponent)
</script>
</body>
</html>