You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
326 B
18 lines
326 B
class MyComponent extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
|
|
const shadow = this.attachShadow({ mode: 'closed' });
|
|
|
|
const root = document.createElement('section');
|
|
root.innerHTML = `
|
|
<h2>Hello from MyComponent!</h2>
|
|
`;
|
|
|
|
shadow.appendChild(root)
|
|
}
|
|
}
|
|
|
|
customElements.define('my-component', MyComponent);
|
|
|