File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -654,8 +654,7 @@ export class VaporComponentInstance implements GenericComponentInstance {
654654 : rawSlots
655655 : EMPTY_OBJ
656656
657- const scopeOwner = getScopeOwner ( )
658- this . scopeId = scopeOwner && scopeOwner . type . __scopeId
657+ this . scopeId = getCurrentScopeId ( )
659658
660659 // apply custom element special handling
661660 if ( comp . ce ) {
@@ -745,8 +744,7 @@ export function createPlainElement(
745744 ; ( el as any ) . $root = isSingleRoot
746745
747746 if ( ! isHydrating ) {
748- const scopeOwner = getScopeOwner ( )
749- const scopeId = scopeOwner ! . type . __scopeId
747+ const scopeId = getCurrentScopeId ( )
750748 if ( scopeId ) setScopeId ( el , [ scopeId ] )
751749 }
752750
@@ -1031,3 +1029,8 @@ function handleSetupResult(
10311029 popWarningContext ( )
10321030 }
10331031}
1032+
1033+ export function getCurrentScopeId ( ) : string | undefined {
1034+ const scopeOwner = getScopeOwner ( )
1035+ return scopeOwner && scopeOwner . type . __scopeId
1036+ }
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import {
4545 type VaporComponent ,
4646 VaporComponentInstance ,
4747 createComponent ,
48+ getCurrentScopeId ,
4849 isVaporComponent ,
4950 mountComponent ,
5051 unmountComponent ,
@@ -60,7 +61,7 @@ import {
6061} from '@vue/shared'
6162import { type RawProps , rawPropsProxyHandlers } from './componentProps'
6263import type { RawSlots , VaporSlot } from './componentSlots'
63- import { currentSlotScopeIds , getScopeOwner } from './componentSlots'
64+ import { currentSlotScopeIds } from './componentSlots'
6465import { renderEffect } from './renderEffect'
6566import { _next , createTextNode } from './dom/node'
6667import { optimizePropertyLookup } from './dom/prop'
@@ -350,8 +351,7 @@ function createVDOMComponent(
350351 frag . nodes = vnode . el as any
351352 }
352353
353- const scopeOwner = getScopeOwner ( )
354- vnode . scopeId = ( scopeOwner && scopeOwner . type . __scopeId ) || null
354+ vnode . scopeId = getCurrentScopeId ( ) || null
355355 vnode . slotScopeIds = currentSlotScopeIds
356356
357357 frag . insert = ( parentNode , anchor , transition ) => {
You can’t perform that action at this time.
0 commit comments