can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
24 lines (19 loc) • 635 B
HTML
<checkbox-either-or></checkbox-either-or>
<script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source">
import { stacheConverters, StacheElement } from "can";
class CheckboxEitherOr extends StacheElement {
static view = `
<label>
<input type="checkbox" checked:bind="either-or(this.bestTypeOfPet, 'Dogs', 'Cats')">
Dogs or Cats?
</label>
<p>
The superior pet is: {{ this.bestTypeOfPet }}
</p>
`;
static props = {
bestTypeOfPet: ""
};
};
customElements.define("checkbox-either-or", CheckboxEitherOr);
</script>