Re: [w3c/webcomponents] Update Imperative-Shadow-DOM-Distribution-API.md (#866)

@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