File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,13 @@ export abstract class NodeComponent<T extends Node> {
7676
7777 /**
7878 * Render this component in the place of a `<slot name="…"></slot>`.
79- * If multiple slots with the same name are found, they will all be used.
8079 * @param slot The slot name
8180 * @param [parent] The parent element within to search for slots. Defaults to `document`
8281 */
8382 public slot ( slot : string , parent : ParentNode = document ) {
84- const slotNodes = parent . querySelectorAll ( `slot[name="${ slot } "]` ) ;
85- for ( const slotNode of slotNodes )
86- slotNode . replaceWith ( this . node ) ;
83+ const slotNode = parent . querySelector ( `slot[name="${ slot } "]` ) ;
84+ if ( slotNode == null ) throw new DOMException ( `NodeComponent.slot: Could not find slot ${ slot } ` ) ;
85+ slotNode . replaceWith ( this . node ) ;
8786 return this ;
8887 }
8988}
You can’t perform that action at this time.
0 commit comments