UNPKG

can

Version:

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

35 lines (30 loc) 1.01 kB
<month-picker></month-picker> <script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source"> import { StacheElement } from "can"; class MonthPicker extends StacheElement { static view = ` <label> What month were you born? <select value:bind="this.selectedMonth"> <option>Jan</option> <option>Feb</option> <option>March</option> <option>April</option> <option>May</option> <option>June</option> <option>July</option> <option>Aug</option> <option>Sept</option> <option>Oct</option> <option>Nov</option> <option>Dec</option> </select> </label> <p>Selected month: {{ this.selectedMonth }}</p> `; static props = { selectedMonth: "June" }; }; customElements.define("month-picker", MonthPicker); </script>