-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (29 loc) · 890 Bytes
/
index.js
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
import "./styles.css";
import DrowJS from "./drow";
document.getElementById("app").innerHTML = `
<h1>Hello DrowJS!</h1>
<div>
We use Parcel to bundle this sandbox, you can find more info about Parcel
<a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>.
</div>
`;
var config = {
name: "my-custom",
props: ["message"],
template: `<div>Hello <b> Universe</b></div>`,
init: function() {
//let message = this.getProp("message") ? this.getAttribute("message") : "";
this.getComp().addEventListener("click", e => {
this.getComp().querySelector("b").innerHTML =
" DOM - Clicked: " + new Date();
});
},
watch: function(attribute) {
if (attribute.name === "message") {
attribute.comp.querySelector("b").innerHTML = ` - altered value, ${
attribute.newValue
}`;
}
}
};
//DrowJS.register(config);