Код: Выделить всё
class NotesList extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: "open" });
}
connectedCallback() {
this.foo = this.getAttribute('foo');
this.shadowRoot.innerHTML += `${this.foo}`;
this.shadowRoot.innerHTML += `[list][*]Note 1[/list]`;
}
}
customElements.define("notes-list", NotesList);< /code>
ul {
list-style: none;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... e-custom-e
Мобильная версия