WICG / webcomponents

Web Components specifications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

new conceptual way of creating web components

codehangen opened this issue · comments

I would like to know what you all think of this idea.

webcomponents_sample.js

function WebComponentElement(elementName, elementString, elementNameString){
 const ElementType = webcomponent.extends.HTMLElement(elementName);
  ElementType
    .constructor.super()
    .connectedCallback(() => innerHTML(elementString));
    .define(elementNameString, ElementType);
 return ElementType;
}

// <p>Hello, <b>World</b>!</p>
WebComponentElement("p", "ElementParagraph", `<p>Hello, <b>World</b>!</p>`);

// <ul>Hello, <li>World</li>!</ul>
WebComponentElement("ul", "ElementUL", `<ul>Hello, <li>World</li>!</ul>`);