- From: yuzhehan <notifications@github.com>
- Date: Tue, 14 Apr 2020 12:06:48 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 14 April 2020 19:07:01 UTC
@yuzhe-han commented on this pull request. > ```js -const sr = attachShadow({ mode: ..., (optional) slotting: 'manual' }) +class CustomTab extends HTMLElement { + constructor() { + super(); + const template = ` + <div class="custom-tab"> + <slot></slot> + </div>`; + const shadowRoot = this.attachShadow({mode: 'open', slotAssignment: 'manual'}); + const div = document.createElement('div'); + div.innerHTML = template; + shadowRoot.appendChild(div); + } + connectedCallback() { I've updated my example to include attributeChangedCallback. Thanks. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/pull/866#discussion_r408369601
Received on Tuesday, 14 April 2020 19:07:01 UTC