assign(node1)
assign(node1, node2)
assign(node1, node2, /* â¦, */ nodeN)
Parameters
Return value
None (undefined
).
NotAllowedError
DOMException
Thrown when calling this method on an automatically assigned slot.
In the example below, the assign()
method is used to display the correct tab in a tabbed application. The function is called and passed the panel to show, which is then assigned to the slot.
function UpdateDisplayTab(elem, tabIdx) {
const shadow = elem.shadowRoot;
const slot = shadow.querySelector("slot");
const panels = elem.querySelectorAll("tab-panel");
if (panels.length && tabIdx && tabIdx <= panels.length) {
slot.assign(panels[tabIdx - 1]);
} else {
slot.assign();
}
}
Specifications Browser compatibility
Loadingâ¦
See alsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5