File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -635,7 +635,7 @@ export class VueElement
635635 * Only called when shadowRoot is false
636636 */
637637 private _renderSlots ( ) {
638- const outlets = [ ... getSlots ( this . _teleportTargets ) , ... getSlots ( [ this ] ) ]
638+ const outlets = this . _getSlots ( )
639639 const scopeId = this . _instance ! . type . __scopeId
640640 for ( let i = 0 ; i < outlets . length ; i ++ ) {
641641 const o = outlets [ i ] as HTMLSlotElement
@@ -663,6 +663,19 @@ export class VueElement
663663 }
664664 }
665665
666+ /**
667+ * @internal
668+ */
669+ private _getSlots ( ) : HTMLSlotElement [ ] {
670+ const roots : HTMLElement [ ] = [ this ]
671+ if ( this . _teleportTargets ) {
672+ roots . push ( ...this . _teleportTargets )
673+ }
674+ return roots . reduce < HTMLSlotElement [ ] > ( ( res , i ) => {
675+ res . push ( ...Array . from ( i . querySelectorAll ( 'slot' ) ) )
676+ return res
677+ } , [ ] )
678+ }
666679 /**
667680 * @internal
668681 */
@@ -716,11 +729,3 @@ export function useShadowRoot(): ShadowRoot | null {
716729 const el = __DEV__ ? useHost ( 'useShadowRoot' ) : useHost ( )
717730 return el && el . shadowRoot
718731}
719-
720- function getSlots ( roots : HTMLElement [ ] | undefined ) : HTMLSlotElement [ ] {
721- if ( ! roots ) return [ ]
722- return roots . reduce < HTMLSlotElement [ ] > ( ( res , i ) => {
723- res . push ( ...Array . from ( i . querySelectorAll ( 'slot' ) ) )
724- return res
725- } , [ ] )
726- }
You can’t perform that action at this time.
0 commit comments