import { define, WeElement, html } from "omi"; class MyCounter extends WeElement { static get propTypes() { return { count: Number }; } static get defaultProps() { return { count: 0 }; } install() { this.data = { count: this.props.count }; } static get css() { return ` * { font-size: 200%; } span { width: 4rem; display: inline-block; text-align: center; } button { width: 64px; height: 64px; border: none; border-radius: 10px; background-color: seagreen; color: white; } `; } inc = () => { this.data.count++; this.update(); }; dec = () => { this.data.count--; this.update(); }; render(props) { return html` ${this.data.count} `; } } define("my-counter", MyCounter);