UNPKG

can

Version:

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

35 lines (29 loc) 823 B
<name-form></name-form> <script src="../../node_modules/steal/steal.js" dev-bundle main="@empty" id="demo-source"> import { StacheElement } from "can"; class NameForm extends StacheElement { static view = ` <form on:submit="this.handleSubmit(scope.event)"> <p> <label> First Name: <input type="text"> </label> </p> <p> <label> Last Name: <input type="text"> </label> </p> <input type="submit"> </form> `; static props = {}; handleSubmit(event) { event.preventDefault(); // handle form submission here } }; customElements.define("name-form", NameForm); </script>