Created
October 1, 2019 17:29
-
-
Save LucasBadico/109b4e7d31307237b0761140c5e055a5 to your computer and use it in GitHub Desktop.
webcomponent sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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