-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
47 lines (41 loc) · 1.08 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
<html>
<head>
<title>Demo of element-lite</title>
</head>
<body>
<test-component></test-component>
<script type="module">
import { ElementLiteBase } from './element-lite-base.js';
class TestComponent extends ElementLiteBase(window.HTMLElement) {
static get is () { return 'test-component'; }
static get properties () {
return {
prop1: {
type: String,
value: 'Hello',
observer: '_testMethod'
},
prop2: {
type: String,
value: 'World',
observer: '_testMethod'
}
};
}
static get observers () {
return [
'_testTwoProps(prop1, prop2)',
'_testTwoProps(prop2, prop1)'
];
}
_testMethod (prop1) {
console.log(prop1);
}
_testTwoProps (prop1, prop2) {
console.log(prop1, prop2);
}
}
window.customElements.define(TestComponent.is, TestComponent);
</script>
</body>
</html>