File tree 1 file changed +6
-2
lines changed
packages/runtime-core/src
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -166,12 +166,16 @@ export function renderComponentRoot(
166
166
167
167
// inherit scopeId
168
168
const scopeId = vnode . scopeId
169
+ // vite#536: if subtree root is created from parent slot if would already
170
+ // have the correct scopeId, in this case adding the scopeId will cause
171
+ // it to be removed if the original slot vnode is reused.
172
+ const needScopeId = scopeId && root . scopeId !== scopeId
169
173
const treeOwnerId = parent && parent . type . __scopeId
170
174
const slotScopeId =
171
175
treeOwnerId && treeOwnerId !== scopeId ? treeOwnerId + '-s' : null
172
- if ( scopeId || slotScopeId ) {
176
+ if ( needScopeId || slotScopeId ) {
173
177
const extras : Data = { }
174
- if ( scopeId ) extras [ scopeId ] = ''
178
+ if ( needScopeId ) extras [ scopeId ] = ''
175
179
if ( slotScopeId ) extras [ slotScopeId ] = ''
176
180
root = cloneVNode ( root , extras )
177
181
}
You can’t perform that action at this time.
0 commit comments