1261351-iframe.html (736B)
1 <body> 2 <script type="application/javascript"> 3 'use strict'; 4 // -sp-context: content 5 (function () { 6 class UiComponentTest extends HTMLDivElement { 7 constructor() { 8 super(); 9 this.template = `<style></style>`; 10 } 11 12 connectedCallback() { 13 let shadow = this.attachShadow({ mode: "open" }); 14 if (this.template) { 15 let te = document.createElement('template'); 16 te.innerHTML = this.template; 17 shadow.appendChild(document.importNode(te.content, true)); 18 } 19 } 20 }; 21 22 customElements.define('ui-component-test', UiComponentTest, { extend: 'div'} ); 23 24 let uic = new UiComponentTest(); 25 document.body.appendChild(uic); 26 })(); 27 </script> 28 </body>