我可以使用tr(表格行)作为命名插槽吗?当我使用tr作为树懒的后备内容时会发生什么?
像这样:
<x-table>
<tr slot="x-row">
<td>data</td>
<td>data</td>
</tr>
</x-table>
codepen https://codepen.io/JJia/pen/odXrWJ中的示例代码
<tr>
元素必须具有parent among <thead>
, <tbody>
, <tfoot>
or <table>
元素。
不幸的是,这些元素不能支持Shadow DOM。请参阅elements with the attachShadow()
method列表。
因此,他们的第一级孩子(即<tr>
)不能与slot
属性一起使用。