feat(templates): add data access explanation
This commit is contained in:
parent
7f6cf37224
commit
38596b1152
1 changed files with 5 additions and 0 deletions
|
@ -13,6 +13,11 @@ class HelloWorld extends WebComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
get template() {
|
get template() {
|
||||||
|
/**
|
||||||
|
* any attribute/property in kebab-case...
|
||||||
|
* can be accessed via its camelCase counterpart
|
||||||
|
* example: data-name prop is accessible as this.dataName
|
||||||
|
*/
|
||||||
return `<button style="cursor:pointer">Hello ${this.dataName}!</button>`;
|
return `<button style="cursor:pointer">Hello ${this.dataName}!</button>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue