web_components_practice/poots.js
2024-06-24 19:42:50 -04:00

26 lines
No EOL
643 B
JavaScript

const template = document.createElement('template')
template.innerHTML = `
<div>
<h2> WEPA! </h2>
<slot name="keyblades">Default text is no slot used in html</slot>
<slot name="list"> </slot>
</div>
`;
class Poots extends HTMLElement {
constructor() {
super();
const shadowRoot = this.attachShadow({mode: 'closed'});
/* let div = document.createElement('div');
div.textContent = 'WEPA!! MAS POOOOOOOO';
shadowRoot.append(div); */
let clone = template.content.cloneNode(true);
shadowRoot.append(clone);
}
}
customElements.define('poots-poot', Poots);