UNPKG

can

Version:

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

27 lines (21 loc) 512 B
<body> <div id='demo-html'> <my-counter count:from='5'></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='increment()'>+1</button> Count: <span>{{ count }}</span> `; static props = { count: 0 }; increment() { this.count++; } }; customElements.define("my-counter", MyCounter); </script> </body>