Lifecycle
by Aggre _--
HTML
<x-app></x-app>
JavaScript
import { LitElement, html, property } from '@polymer/lit-element'
class MyElement extends LitElement {
@property()
foo = 'foo'
@property({ type: Number })
whales = 5
render() {
return html`
<style>
:host {
display: block;
}
</style>
<h4>Foo: ${this.foo}</h4>
<div>whales: ${'🐳'.repeat(this.whales)}</div>
<slot></slot>
`
}
}
customElements.define('my-element', MyElement)