Skip to content

Instantly share code, notes, and snippets.

@AhsanAyaz
Created February 25, 2018 09:17
Show Gist options
  • Save AhsanAyaz/c3fa8d277719f549df21c3a3d3e4eec3 to your computer and use it in GitHub Desktop.
Save AhsanAyaz/c3fa8d277719f549df21c3a3d3e4eec3 to your computer and use it in GitHub Desktop.
Stop Watch Component built with Stencil
import { Component, Prop } from "@stencil/core";
@Component({
tag: "stop-watch",
styleUrl: "stop-watch.css"
})
export class StopWatchComponent {
@Prop() hours: string;
@Prop() minutes: string;
@Prop() seconds: string;
@Prop() milliseconds: string;
render() {
return (
<div class="watch-wrapper">
<div class="watch">
<div class="unit">{this.hours}</div>
<div class="sep"> : </div>
<div class="unit">{this.minutes}</div>
<div class="sep"> : </div>
<div class="unit">{this.seconds}</div>
<div class="sep"> : </div>
<div class="unit">{this.milliseconds}</div>
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment