Web Components using lit-html
import { html, render } from './lit-html.js';
export default class MyName extends HTMLElement {
constructor() {
super();
}
connectedCallback() {
this.attachShadow({ mode: 'open' });
render(this.template, this.shadowRoot);
}
get template() {
return html`
Name: ${this.getAttribute('name')}
`;
}
};