can
Version:
MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.
35 lines (29 loc) • 838 B
HTML
<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>
<p>
<label>
First Name:
<input type="text">
</label>
</p>
<p>
<label>
Last Name:
<input type="text">
</label>
</p>
<button type="button" on:click="this.handleSubmit(scope.event)">Submit</button>
</form>
`;
static props = {};
handleSubmit(event) {
event.preventDefault();
// handle form submission here
}
};
customElements.define("name-form", NameForm);
</script>