can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
24 lines (20 loc) • 571 B
HTML
<my-checkbox></my-checkbox>
<script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source">
import { StacheElement } from "can";
class MyCheckbox extends StacheElement {
static view = `
<input type="checkbox" checked:to="this.isItChecked">
<p>
{{# if(this.isItChecked) }}
checkbox is checked
{{ else }}
checkbox is unchecked
{{/ if }}
</p>
`;
static props = {
isItChecked: false
};
};
customElements.define("my-checkbox", MyCheckbox);
</script>