Skip to content

Instantly share code, notes, and snippets.

@vbkmr
Last active December 21, 2019 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vbkmr/b0fce5b366c6397e197e30fe0d4b5c3b to your computer and use it in GitHub Desktop.
Save vbkmr/b0fce5b366c6397e197e30fe0d4b5c3b to your computer and use it in GitHub Desktop.
import { Component, Prop, h, Listen, State } from "@stencil/core";
@Component({
tag: "fancy-af-button",
styleUrl: "fancy-af-button.css",
shadow: true
})
export class FancyAFButton {
@State() clickedCount: number = 0;
@Prop() title: string;
@Listen("click", { capture: true })
handleClick() {
this.clickedCount += 1;
}
render() {
return (
<button>
<span>{this.title}</span>
<span> {this.clickedCount}</span>
</button>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment