Skip to content

Instantly share code, notes, and snippets.

@LucasBadico
Created October 1, 2019 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucasBadico/109b4e7d31307237b0761140c5e055a5 to your computer and use it in GitHub Desktop.
Save LucasBadico/109b4e7d31307237b0761140c5e055a5 to your computer and use it in GitHub Desktop.
webcomponent sample
import { LitElement, html } from 'lit-element';
class BackofficeHeader extends LitElement {
static get properties() {
return {
title: String,
subtitle: String,
};
}
render(){
return html`<div>
<h1>${this.title}</h1>${ props.subtitle && `<p>this.subtitle</p>`} <slot></slot>
</div>`;
}
}
customElements.define('backoffice-header', MyElement);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment