diff --git a/demo/HelloWorld.mjs b/demo/HelloWorld.mjs index 7b1a399..3eae46d 100644 --- a/demo/HelloWorld.mjs +++ b/demo/HelloWorld.mjs @@ -2,7 +2,7 @@ import WebComponent from "../src/index.js"; export class HelloWorld extends WebComponent { - name = "World"; + dataName = "World"; emotion = "excited"; static properties = ["data-name", "emotion"]; diff --git a/src/WebComponent.js b/src/WebComponent.js index 7405bb4..2a32984 100644 --- a/src/WebComponent.js +++ b/src/WebComponent.js @@ -8,11 +8,17 @@ * import WebComponent from "https://unpkg.com/web-component-base/index.js"; * * class HelloWorld extends WebComponent { + * // initialize prop + * dataName = 'World'; + * + * // tell the browser which attributes to cause a render * static properties = ["data-name", "emotion"]; * + * // give the component a readonly template + * // note: props have kebab-case & camelCase counterparts * get template() { * return ` - *