HTML Custom Elements (v1)
https://developers.google.com/web/fundamentals/web-components/customelements
Web Components
https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements
https://caniuse.com/#search=HTML Custom Elements
Web Components
Web components is a meta-specification made possible by four other specifications:
The Custom Elements
specification
The shadow DOM
specification
The HTML Template
specification
The ES Module
specification
https://www.webcomponents.org/specs
Custom Elements
An unknown autonomous custom element is like a element: its default CSS display property is inline
瀏覽器不能識別的 HTML Tag 等效於 span 元素, 即 custom element 如果沒有使用 web components 的規范進行 element 注冊的話!
- autonomous custom elements
👍,好使,自己完全控制(屬性,事件,可訪問性)
- customized built-in elements / extending native HTML elements
👎 ,不好使,瀏覽器支持度不高,不推薦
demo
UFO, 未注冊的 custom element
UFO, 注冊的 custom element
Shadow DOM
https://www.webcomponents.org/specs#the-shadow-dom-specification
refs
https://www.webcomponents.org/specs
https://html.spec.whatwg.org/multipage/custom-elements.html
https://github.com/w3c/webcomponents/issues/509
IMHO / 恕我直言
©xgqfrms 2012-2020
www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!