- generic `server.serve` config - new demo workspace - new basic template - updated readme Reviewed-on: https://git.ayo.run/ayo/mcfly/pulls/3 Co-authored-by: Ayo <ayo@ayco.io> Co-committed-by: Ayo <ayo@ayco.io>
23 lines
442 B
JavaScript
23 lines
442 B
JavaScript
/**
|
|
* Custom element using a minimal base class
|
|
* @see https://WebComponent.io
|
|
*/
|
|
class MyHelloWorld extends WebComponent {
|
|
static props = {
|
|
myName: 'World',
|
|
count: 0,
|
|
}
|
|
|
|
updateLabel() {
|
|
this.props.myName = `Clicked ${++this.props.count}x`
|
|
}
|
|
|
|
get template() {
|
|
return html` <button
|
|
onClick=${() => this.updateLabel()}
|
|
style="cursor:pointer"
|
|
>
|
|
Hello ${this.props.myName}!
|
|
</button>`
|
|
}
|
|
}
|