aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/global_attributes/slot/index.html
blob: 43a73a82c56f8b4409d44bdbb6e10b183f26fb4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---
title: slot
slug: Web/HTML/Global_attributes/slot
translation_of: Web/HTML/Global_attributes/slot
---
<div>{{HTMLSidebar("Global_attributes")}}{{SeeCompatTable}}</div>

<p><strong>slot</strong> <a href="/en-US/docs/Web/HTML/Global_attributes">全局属性</a> 将一个 <a href="/en-US/docs/Web/Web_Components/Shadow_DOM">shadow DOM</a> shadow 树中的槽分配给一个元素: 带有 <code>slot</code> 属性的元素分配给由 {{HTMLElement("slot")}} 创建的槽,它的 {{htmlattrxref("name", "slot")}} 属性的值匹配 <code>slot</code> 属性的值。</p>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('HTML WHATWG', "dom.html#attr-slot", "slot attribute")}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('DOM WHATWG', "#dom-element-slot", "slot attribute")}}</td>
   <td>{{Spec2('DOM WHATWG')}}</td>
   <td> </td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<p>{{Compat("html.global_attributes.slot")}}</p>

<h2 id="另见">另见</h2>

<ul>
 <li>所有<a href="/en-US/docs/Web/HTML/Global_attributes">全局属性</a></li>
</ul>