UNPKG

can

Version:

MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.

27 lines (21 loc) 501 B
<body> <div id="demo-html"> <my-counter></my-counter> </div> <script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source"> import { StacheElement } from "can"; class MyCounter extends StacheElement { static view = ` <button on:click="this.increment()">+1</button> Count: <span>{{ this.count }}</span> `; static props = { count: 0 }; increment() { this.count++; } } customElements.define("my-counter", MyCounter); </script> </body>