[w3c/webcomponents] Anonymous custom elements 匿名自定义组件 (#842)

I want to propose a new proposal to the W3C.

Anonymous custom elements
..
Why do custom components have to define a name? Defining names is easy to conflict. Modern front-end frameworks use virtual doms, and the ability to directly write html is too weak.

Because you can't write functions or objects directly in html

I hope I can use custom elements without `define` 
```js
customElements.define()

```
In case of using an constructor to create an anonymous custom component directly
```js
var anonymousElement=new class extends HTMLElement{}
document.body.appendChild(anonymousElement)
```
..

Also want to create anonymous custom components without using document.createElement


Under the current api, you can only randomly define names for custom components.Unable to get all custom components that have been defined


I also wrote a js library that randomly named custom components.


Https://github.com/masx200/custom-elements-random-define

-- 
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/issues/842

Received on Monday, 23 September 2019 00:46:59 UTC