射手男喜欢什么样的女生| 腰椎盘突出挂什么科| 下午3点是什么时辰| 化疗和放疗有什么区别| 贝壳吃什么食物| 洁尔阴洗液有什么作用| 四月九号是什么星座| 早上五点半是什么时辰| cn是什么| 鸡吃什么长得又快又肥| 婴儿血小板低是什么原因| 太阳一晒脸就红是什么原因| 痛风吃什么好得快| 一九八八年属什么生肖| 口酸吃什么药效果好| mo是什么元素| 腿肿应该挂什么科| 减肥能吃什么零食| 股骨长是指什么| 纳米是什么意思| 五行缺木是什么意思| 什么是五谷| 什么是一桌餐| 拉大便肛门口疼痛什么原因| 什么食物铅含量高| yuki是什么意思| 属兔五行属什么| 什么王| 尿黄是因为什么| 气血虚吃什么中成药| 全身出虚汗多是什么原因造成的| 什么时候可以上环最好的| 茶色是什么颜色| 榻榻米床垫什么材质的好| 呼和浩特有什么特产| 冷冻和冷藏有什么区别| 宫颈炎吃什么药好得快| 虬结什么意思| 补肾壮阳吃什么药好| 腋窝痒是什么原因| 世界第一大河是什么河| 什么水果去湿气效果最好| 木生什么| 地是什么生肖| 复原是什么意思| 焗油是什么意思| 南海龙王叫什么| 蝴蝶的翅膀像什么| 养字五行属什么| 胰腺在什么位置| b超和阴超有什么区别| 喝完酒胃疼吃什么药| plover是什么牌子| 做nt需要做什么准备| 薷是什么意思| 浑身乏力吃什么药| 清炖排骨都放什么调料| 菠萝蜜吃多了有什么坏处| 火六局是什么意思| 什么是伤官配印| 什么的虫子| 老爹鞋适合什么人穿| 专升本有什么专业| 为什么会缺钾| 蜈蚣最怕什么药| 考试为什么要用2b铅笔| 舌苔白腻是什么原因| 感冒应该挂什么科| 阿佛洛狄忒是什么神| 安之若素是什么意思| 羊肉炖什么好吃| 什么是肿瘤| 狗为什么不能吃洋葱| 薛之谦为什么离婚| 18号来月经什么时候是排卵期| pro是什么氨基酸| 水为什么会结冰| 两毛四是什么军衔| 612是什么星座| 破涕为笑什么意思| 失眠是什么原因| 吃什么能快速排便| 一戴套就软是什么原因| 左眼屈光不正是什么意思| 灬是什么意思| 老公不交工资意味什么| 什么时候普及高中| 什么时候容易怀孕| 什么是蜘蛛痣图片| 肺动脉高压用什么药| 商朝之后是什么朝代| 闭关什么意思| 脚气缺什么维生素| 希鲮鱼是什么鱼| macd什么意思| 肌肤甲错是什么意思| 1RM什么意思| 荨麻疹抹什么药膏| 危楼高百尺的危是什么意思| 嗓子有黄痰是什么原因| 为什么经常刷牙还牙黄| 何方珠宝是什么档次| 糖尿病人适合吃什么水果| 6月21是什么星座| 天秤座有什么特点| 你为什么不快乐| 白头发吃什么可以变黑| 嘴巴长溃疡是什么原因| da医学上是什么意思| 女生下面长什么样| 胸口闷闷的有点疼是什么原因| 美人盂是什么意思| 嘴唇发紫是什么原因| 2024年什么年| 老人经常头晕是什么原因引起的| 女人什么时候最想男人| 粿条是什么做的| 性激素六项挂什么科| 咖啡喝多了有什么危害| 食道挂什么科| 珑骧包属于什么档次| 下巴下面长痣代表什么| 额头长痘痘是什么原因怎么调理| 为什么家里会有蜈蚣| lpn什么意思| 关税是什么意思| 鱼腥草破壁饮片有什么功效| 梅毒长什么样子| 便秘有什么症状| 美莎片是什么药| 煮酒论英雄什么意思| 肾属于什么科| 大什么大什么| 三个七念什么| pc是什么意思啊| 为什么眼睛会有红血丝| 小巫见大巫是什么意思| 精神衰弱吃什么能改善| 南瓜和窝瓜有什么区别| 穿拖鞋脚臭是什么原因| 7月1号是什么星座| 北海特产有什么值得带| 精索静脉曲张是什么| 吃三七粉有什么效果| 冯庸大学现在叫什么| 为什么夏天容易掉头发| 华在姓氏里读什么| 终止是什么意思| fgr医学上是什么意思| 减肥去医院挂什么科| 龟奴是什么| 玻璃体混浊用什么药| 护手霜什么牌子的效果好| 哈士蟆是什么东西| 三叉神经痛吃什么药| 榴莲补什么| 倍感欣慰是什么意思| 荧光黄是什么颜色| 口是心非什么意思| 江西古代叫什么| 去离子水是什么| 石斛起什么作用| 痤疮用什么药膏最有效| 心脏t波改变是什么意思| 早上适合做什么运动| 圣诞节什么时候| 诸事不宜什么意思| 脑门痒痒是什么预兆| 小白和兽神什么关系| nerdy是什么牌子| 大便很黄是什么原因| 时点是什么意思| 鼻炎吃什么药效果最好| 阴历六月十五是什么日子| 登高望远是什么生肖| 喉咙痛上火吃什么药效果最好| 声带白斑是什么病严重吗| 不小心怀孕了吃什么药可以流掉| 重逢是什么意思| 早餐吃什么| 节度使是什么意思| 什么是硬水| 什么哲理| 白细胞偏高是什么原因| 披靡是什么意思| 牡丹什么时候开| 自怨自艾是什么意思| 尿常规红细胞高是什么原因| 黑色素痣挂什么科| 失能是什么意思| 50岁女人出轨为了什么| 胃肠外科是看什么病的| 什么是黄体| 沙拉是什么意思| 985和211有什么区别| 总恶心是什么病的前兆| 包皮真菌感染用什么药| 梦见狗咬别人是什么意思| 平常平时叫什么日| 5月3日是什么星座| 电风扇什么牌子质量好| 抑郁症什么意思| 乳腺化疗期间吃什么| 梦见苍蝇是什么预兆| 穿什么衣服显白| 11月16日是什么星座| 血稠是什么原因造成的| 阳历九月份是什么星座| 丙申五行属什么| 鱼腥草泡水喝有什么功效| 舌面上有裂纹是什么病| 细菌性阴道炎有什么症状| 血管没有弹性是什么原因| 悟性是什么意思| 便士是什么意思| 九夫痣是什么意思| 丰富是什么意思| 血压高有什么症状| 飞机打多了会有什么后果| 蜜蜂是什么牌子| 脑瘤早期什么症状| 香菇炒什么好吃| 气胸吃什么药好得快| 过房是什么意思| 瑶字五行属什么| ktv是什么意思| 琅玕是什么意思| 文气是什么意思| 牙髓炎吃什么药最有效| 罗非鱼吃什么食物| 性欲是什么| 什么生肖最旺鸡| 孕激素是什么| 喝茶叶水有什么好处和坏处| 紫藤花什么时候开| 龛影是什么意思| 眩晕症吃什么药| 瑞五行属性是什么| 七月二十八什么星座| 为什么文化大革命| gj是什么意思| 知觉是什么意思| 华丽的什么| 什么叫词牌名| 男性硬不起来什么原因| 人参和什么泡酒最好| 什么的叫| 吃纳豆有什么好处| 以马内利是什么意思| 蟑螂喜欢吃什么东西| 寅时五行属什么| 02年是什么生肖| 天然是什么意思| 宫腔内高回声是什么意思| 舌苔白吃什么药| 宫腔粘连是什么意思| 面红耳赤是什么生肖| 丁克是什么| 顶臀径是指什么| 洗牙为什么要验血| 拔了牙吃什么消炎药| 67什么意思| 术后吃什么刀口恢复得快| 面瘫去医院挂什么科| 百度Jump to content

From Wikipedia, the free encyclopedia
百度 但如果美国的做法违反了世贸组织的规定,那将会导致贸易争端,中国也不会坐以待毙;第三,对钢铁和铝进口增加贸易限制不仅对中国造成冲击,也会伤害澳大利亚、加拿大、日本等美盟友的利益。

Web Components are a set of features that provide a standard component model for the web[1] allowing for encapsulation and interoperability of individual HTML elements. Web Components are a popular approach when building microfrontends.

Primary technologies used to create Web Components include:[2]

Custom Elements
APIs to define new HTML elements
Shadow DOM
encapsulated DOM and styling, with composition
HTML Templates
HTML fragments that are not rendered, but stored until instantiated via JavaScript[3]

Features

[edit]

Custom Elements

[edit]

There are two parts to Custom Elements: autonomous custom elements and customized built-in elements. Autonomous custom elements are HTML elements that are entirely separated from native HTML elements; they are essentially built from the bottom up using the Custom Elements API. Customized built-in elements are elements that are built upon native HTML elements to reuse their functionality.[4]

Shadow DOM

[edit]

The Shadow DOM is a functionality that allows the web browser to render DOM elements without putting them into the main document DOM tree. This creates a barrier between what the developer and the browser can reach; the developer cannot access the Shadow DOM in the same way they would with nested elements, while the browser can render and modify that code the same way it would with nested elements. The impact of CSS scoped within the Shadow DOM of a particular element is that HTML elements can be encapsulated without the risk of CSS styles leaking and affecting elements that they were not supposed to affect. Although these elements are encapsulated with regard to HTML and CSS, they can still fire events that can be picked up by other elements in the document.[5][6]

The scoped subtree in an element is called a shadow tree. The element the shadow tree is attached to is called a shadow host.[6]

A Shadow DOM must always be connected to an existing element, either through attaching it as a literal element or through scripting. In JavaScript, Shadow DOMs are attached to an element using Element.attachShadow().[7]

HTML Template

[edit]

A HTML template is a way to insert chunks of HTML that are cloned from the template at will. The syntax of HTML templates looks like this:

<html>
    <template>
        <h1><slot name="title"></slot></h1>
        <p><slot name="description"></slot></p>
    </template>
</html>

Scripts will not run, and resources that are inside a template will not be fetched until the template is instantiated.[8]

Browser support

[edit]

Web Components are supported by current versions of all major browsers.[9]

Backward compatibility with older browsers is implemented using JavaScript-based polyfills.

Libraries

[edit]

There are many libraries that are built on Web Components with the aim of increasing the level of abstraction when creating custom elements. Some of these libraries are X-Tag, Slim.js, Polymer, Bosonic, Riot.js, Salesforce Lightning Web Components, DataFormsJS, Telepathy, and Wompo

Community

[edit]

There are numerous community efforts for the Web Components ecosystem. WebComponents.org[10] provides an interface to search for any existing Web Components. Custom Elements Everywhere[11] validates whether popular front-end frameworks are compatible and ready to use Web Components standard, with a set of pending bugs and available workarounds. Moreover, Vaadin Tutorials[12] has a dedicated section that shows how those workarounds are used efficiently with example demo apps and similarly related topics.

History

[edit]

In 2011, Web Components were introduced for the first time by Alex Russell at Fronteers Conference.[13]

In 2013, Polymer, a library based on Web Components was released by Google.[14] Polymer is canonical implementation of Material Design for web application user interfaces.

In 2016, RequireJS was introduced as JavaScript library and AMD loader plugin for custom elements.[15]

In 2017, Ionic (mobile app framework) team built StencilJS, a JavaScript compiler that generates Web Components.[16]

In 2018, Angular 6 introduced Angular Elements that lets you package your Angular components as custom web elements, which are part of the web components set of web platform APIs.[17]

In 2018, Firefox 63 enabled Web Components support by default and updated the developer tools to support them.[18]

In 2018, LitElement was developed by the Google Chrome team as part of larger Polymer project. LitElement was designed to be a lightweight and easy-to-use framework for creating web components.

See also

[edit]

References

[edit]
  1. ^ GitHub - w3c/webcomponents: Web Components specifications., World Wide Web Consortium, 2025-08-05, retrieved 2025-08-05
  2. ^ "Web Components". MDN Web Docs. Retrieved 2025-08-05.
  3. ^ "<template>: The Content Template element". MDN Web Docs. Mozilla. Retrieved 2025-08-05.
  4. ^ "Custom Elements". www.w3.org. Retrieved 2025-08-05.
  5. ^ "What the Heck is Shadow DOM?". Dimitri Glazkov. 2025-08-05. Retrieved 2025-08-05.
  6. ^ a b "Shadow DOM v1: Self-Contained Web Components | Web | Google Developers". Google Developers. Retrieved 2025-08-05.
  7. ^ "Shadow DOM". Mozilla Developer Network. Retrieved 2025-08-05.
  8. ^ Community. "Introduction to the template elements — WebComponents.org". webcomponents.org. Retrieved 2025-08-05.
  9. ^ "webcomponents.org - Discuss & share web components". www.webcomponents.org. Retrieved 2025-08-05.
  10. ^ "Search available Web Components".
  11. ^ "Validate Front-end Frameworks with Web Components Standard".
  12. ^ "Web Components Tutorials".
  13. ^ "Web Components and Model Driven Views by Alex Russell · Fronteers". fronteers.nl. Retrieved 2025-08-05.
  14. ^ "The state of Web Components ★ Mozilla Hacks – the Web developer blog". hacks.mozilla.org. Retrieved 2025-08-05.
  15. ^ "RequireJS in Commerce".
  16. ^ "Web Component Solutions: A Comparison".
  17. ^ "How to create Angular 6 Custom Elements and Web Components".
  18. ^ "Developer Tools support for Web Components in Firefox 63".
[edit]


月经失调是什么原因引起的 再障性贫血是什么病 第二性征是什么 浅表性胃炎吃什么药 逼是什么
黄体破裂是什么 什么终于什么造句 桌游是什么 益生元和益生菌有什么区别 蚊子喜欢咬什么血型
什么是一体机 榴莲为什么那么贵 脑瘤是什么原因引起的 ca153是什么检查项目 骨化性肌炎是什么病
浅是什么意思 脾切除后有什么影响 congee是什么意思 推杯换盏什么意思 外阴长什么样
crispi是什么牌子hcv7jop6ns4r.cn 7月1日什么星座adwl56.com 芥末为什么会冲鼻hcv8jop1ns5r.cn 小孩为什么经常流鼻血hcv8jop1ns3r.cn 一马平川是什么生肖cj623037.com
琨字五行属什么hcv8jop2ns5r.cn 94是什么意思onlinewuye.com 12岁生日有什么讲究hcv7jop6ns7r.cn 木耳菜又叫什么菜hcv8jop2ns1r.cn 口干舌燥口苦吃什么药hcv8jop3ns8r.cn
狗狗窝咳吃什么药最好hcv9jop1ns9r.cn ct值是什么意思hcv8jop7ns1r.cn 脑震荡挂什么科hcv9jop6ns6r.cn 姓名字号是什么意思hanqikai.com 红血丝用什么护肤品修复比较好hcv8jop7ns4r.cn
生理期没来是什么原因hcv7jop6ns0r.cn 河堤是什么意思hcv9jop4ns8r.cn 竹节虫吃什么hcv9jop3ns3r.cn 糖尿病是什么原因造成的hcv9jop0ns7r.cn 青云志3什么时候上映hcv7jop9ns2r.cn
百度