can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
22 lines (17 loc) • 472 B
HTML
<my-counter></my-counter>
<script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source">
import { StacheElement } from "can";
class MyCounter extends StacheElement {
static view = `
<p>{{ this.count }}</p>
<button on:click="this.plusOne()">Click Here</button>
`;
static props = {
count: 0
};
plusOne() {
this.count += 1;
}
};
customElements.define("my-counter", MyCounter);
</script>