|
|
@@ -14,7 +14,7 @@ import {
|
|
|
isVNode,
|
|
|
openBlock,
|
|
|
} from '../vnode'
|
|
|
-import { PatchFlags, SlotFlags } from '@vue/shared'
|
|
|
+import { PatchFlags, SlotFlags, isSymbol } from '@vue/shared'
|
|
|
import { warn } from '../warning'
|
|
|
import { isAsyncWrapper } from '../apiAsyncComponent'
|
|
|
|
|
|
@@ -72,15 +72,16 @@ export function renderSlot(
|
|
|
}
|
|
|
openBlock()
|
|
|
const validSlotContent = slot && ensureValidVNode(slot(props))
|
|
|
+ const slotKey =
|
|
|
+ props.key ||
|
|
|
+ // slot content array of a dynamic conditional slot may have a branch
|
|
|
+ // key attached in the `createSlots` helper, respect that
|
|
|
+ (validSlotContent && (validSlotContent as any).key)
|
|
|
const rendered = createBlock(
|
|
|
Fragment,
|
|
|
{
|
|
|
key:
|
|
|
- (props.key ||
|
|
|
- // slot content array of a dynamic conditional slot may have a branch
|
|
|
- // key attached in the `createSlots` helper, respect that
|
|
|
- (validSlotContent && (validSlotContent as any).key) ||
|
|
|
- `_${name}`) +
|
|
|
+ (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) +
|
|
|
// #7256 force differentiate fallback content from actual content
|
|
|
(!validSlotContent && fallback ? '_fb' : ''),
|
|
|
},
|