Backtestsvuerun-20261007-145226#15048
Scoped slot transforms array argument if rendered conditionally
Our patch was judged better than the merged fix.
In this judgment, Patch A = our agent, Patch B = the merged fix.
Both patches fix the core v-if case the same way. When a `<slot>` gets a compiler-injected key, the key goes to a new 6th `renderSlot()` argument instead of being merged into the slot props, and the runtime gives a user-provided `props.key` precedence. For `<slot v-if v-bind="arr">`, both now emit `_renderSlot($slots, "default", _normalizeProps(_guardReactiveProps(arr)), undefined, undefined, 0)`, so the array reaches the slot unchanged.
Patch A is more thorough on correctness. It also stops `pushRefVForMarker()` from adding `ref_for: true` to a slot's v-bind object. Without that, `<slot v-for ... v-bind="g">` and keyed `<template v-for><slot v-bind="g.items"/></template>` would still become `mergeProps({ref_for: true}, g)` and turn the array into an object. That is the same class of bug the issue reports (behaviour changing depending on surrounding directives). Patch B does not touch `buildProps`, so in v-for contexts the array is still converted, and its key-only injection there does not help.
Patch A's change is also narrower. It only reroutes the key for the single-v-bind-expression case and leaves the existing `{ key: 0 }` object-literal output intact, which is harmless because that is already an object. Patch B reroutes every slot key injection, changes existing snapshots, and widens the `RenderSlotCall` AST types. That is more churn and more risk.
On tests, Patch A adds compiler tests for v-if/v-else, v-for and keyed template v-for, runtime `renderSlot` tests, and full compile-plus-runtime integration tests. These include `Array.isArray` checks and a keyed reorder. Patch B's tests cover v-if and the runtime, including custom-element mode. However, it also writes a vFor snapshot entry into `transformElement.spec.ts.snap`, which is sloppy and points to a test-harness mistake.
Overall, Patch A fixes the root cause across the related scenarios with cleaner scope and stronger tests.
The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.
Solve
12m 5s
Wall-clock time in the container
Full test suite
No new failures
3,630 passed · 6 skipped · 3,636 total
Contamination audit
Clean
No sign the agent saw the real fix
Patch size
192vs 266 merged
Changed lines, ours vs merged
The issue
View on GitHubVue version
3.5.0
Link to minimal reproduction
Steps to reproduce
- Create a component with a scoped slot that is rendered conditionally
- Pass an array as the sole argument to the slot
What is expected?
Array is rendered normally.
If you render items of that array in v-for loop, you only see items inside that array
What is actually happening?
Array is transformed into object. Items and their indexes are staying the same, key field is added
<img width="383" height="111" alt="Image" src="https://github.com/user-attachments/assets/338bc873-5c20-4fb3-aed9-88f9f8e8cd98" />
System Info
Any additional comments?
key attribute is generated by the compiler for the slot rendered with v-if.
<img width="781" height="243" alt="Image" src="https://github.com/user-attachments/assets/99704cf9-71cb-435d-ba6f-92578b65ff5d" />
While this is not explicitly mentioned in documentation, one can assume that the expectation is that slotProps is always an object, as this is what will be passed to the slot if you use multiple v-bind directives on the slot.
This issue is rather pointing out the difference in behavior of the slot when v-if is present or not present.
The two patches
packages/compiler-core/__tests__/transforms/vFor.spec.tsindex 34991445c..b72d2c298 100644@@ -941,6 +941,45 @@ describe('compiler: v-for', () => { expect(generate(root).code).toMatchSnapshot() }) + test('template v-for key injection w/ <slot/> single v-bind expression', () => {+ const {+ root,+ node: { codegenNode },+ } = parseWithForTransform(+ '<template v-for="item in items" :key="item.id"><slot v-bind="item.list"/></template>',+ )+ // key must not be merged into the slot props (they may be an array)+ expect(+ assertSharedCodegen(codegenNode, true, true /* custom return */),+ ).toMatchObject({+ returns: {+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: RENDER_SLOT,+ arguments: [+ '$slots',+ '"default"',+ { arguments: [{ arguments: [{ content: 'item.list' }] }] },+ 'undefined',+ 'undefined',+ { content: 'item.id' },+ ],+ },+ })+ expect(generate(root).code).toMatch(+ `_renderSlot($slots, "default", _normalizeProps(_guardReactiveProps(item.list)), undefined, undefined, item.id)`,+ )+ })++ test('v-for on <slot/> w/ single v-bind expression', () => {+ const { root } = parseWithForTransform(+ '<slot v-for="item in items" v-bind="item.list"></slot>',+ )+ // no ref_for marker merged into the slot props (they may be an array)+ expect(generate(root).code).toMatch(+ `_renderSlot($slots, "default", _normalizeProps(_guardReactiveProps(item.list)))`,+ )+ })+ test('v-for on <slot/>', () => { const { root,packages/compiler-core/__tests__/transforms/vIf.spec.tsindex fe3aef714..63148ffb0 100644@@ -527,6 +527,43 @@ describe('compiler: v-if', () => { expect(generate(root).code).toMatchSnapshot() }) + test('v-if on <slot/> w/ single v-bind expression', () => {+ const {+ root,+ node: { codegenNode },+ } = parseWithIfTransform(+ `<slot v-if="ok" v-bind="items"></slot><slot v-else v-bind="other"/>`,+ )+ // key must not be merged into the slot props (they may be an array)+ expect(codegenNode.consequent).toMatchObject({+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: RENDER_SLOT,+ arguments: [+ '$slots',+ '"default"',+ { arguments: [{ arguments: [{ content: 'items' }] }] },+ 'undefined',+ 'undefined',+ { content: '0' },+ ],+ })+ expect(codegenNode.alternate).toMatchObject({+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: RENDER_SLOT,+ arguments: [+ '$slots',+ '"default"',+ { arguments: [{ arguments: [{ content: 'other' }] }] },+ 'undefined',+ 'undefined',+ { content: '1' },+ ],+ })+ expect(generate(root).code).toMatch(+ `_renderSlot($slots, "default", _normalizeProps(_guardReactiveProps(items)), undefined, undefined, 0)`,+ )+ })+ test('v-if + v-else', () => { const { root,packages/compiler-core/src/transforms/transformElement.tsindex 40f08d45b..41822f253 100644@@ -638,7 +638,9 @@ export function buildProps( } // #10696 in case a v-bind object contains ref- pushRefVForMarker()+ // (not for <slot>: its v-bind object is passed to the slot function+ // as-is and must not be merged, e.g. it may be an array)+ if (node.tagType !== ElementTypes.SLOT) pushRefVForMarker() pushMergeArg() mergeArgs.push(exp) } else {packages/compiler-core/src/utils.tsindex aa426bbab..c9aa0f4ad 100644@@ -445,6 +445,16 @@ export function injectProp( props.properties.unshift(prop) } propsWithInjection = props+ } else if (node.type !== NodeTypes.VNODE_CALL) {+ // single v-bind with expression on a <slot>: the expression is passed+ // to the slot function as-is (and may be e.g. an array), so merging the+ // key into it would alter the slot props. Pass the key as a separate+ // renderSlot() argument instead.+ const args = node.arguments as CallExpression['arguments']+ if (args.length < 4) args[3] = 'undefined' // fallback+ if (args.length < 5) args[4] = 'undefined' // noSlotted+ args[5] = prop.value+ return } else { // single v-bind with expression, return a merged replacement propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [packages/runtime-core/__tests__/helpers/renderSlot.spec.tsindex bc0678b51..9162d260c 100644@@ -32,6 +32,33 @@ describe('renderSlot', () => { expect(vnode.key).toBe('foo') }) + it('should use separately passed key without altering slot props', () => {+ const props = ['a', 'b']+ let received: any+ const vnode = renderSlot(+ { default: (p: any) => ((received = p), [h('div')]) },+ 'default',+ props as any,+ undefined,+ undefined,+ 1,+ )+ expect(received).toBe(props)+ expect(vnode.key).toBe('1')+ })++ it('should prefer key in slot props over separately passed key', () => {+ const vnode = renderSlot(+ { default: () => [h('div')] },+ 'default',+ { key: 'foo' },+ undefined,+ undefined,+ 1,+ )+ expect(vnode.key).toBe('foo')+ })+ it('should allow symbol values for slot prop key', () => { const key = Symbol() const vnode = renderSlot({ default: () => [h('div')] }, 'default', { key })packages/runtime-core/src/helpers/renderSlot.tsindex 8f65f8af4..72c1ca198 100644@@ -16,7 +16,7 @@ import { isVNode, openBlock, } from '../vnode'-import { PatchFlags, SlotFlags, isSymbol } from '@vue/shared'+import { PatchFlags, SlotFlags, extend, isSymbol } from '@vue/shared' import { warn } from '../warning' import { isAsyncWrapper } from '../apiAsyncComponent' @@ -32,6 +32,10 @@ export function renderSlot( // the compiler and guaranteed to be a function returning an array fallback?: () => VNodeArrayChildren, noSlotted?: boolean,+ // branch / loop key generated by the compiler when the slot props are a+ // single `v-bind` expression, kept separate so that the props object passed+ // to the slot is not altered (e.g. an array stays an array)+ key?: PropertyKey, ): VNode { if ( currentRenderingInstance!.ce ||@@ -39,6 +43,7 @@ export function renderSlot( isAsyncWrapper(currentRenderingInstance!.parent) && currentRenderingInstance!.parent.ce) ) {+ if (key !== undefined) props = extend({ key }, props) const hasProps = Object.keys(props).length > 0 // in custom element mode, render <slot/> as actual slot outlets // wrap it with a fragment because in shadowRoot: false mode the slot@@ -79,7 +84,8 @@ export function renderSlot( try { const validSlotContent = slot && ensureValidVNode(slot(props)) const slotKey =- props.key ||+ // user-provided key in the props takes precedence over the compiler key+ (props.key != null ? props.key : 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)packages/vue/__tests__/index.spec.tsindex 6eeff41dd..999db6a83 100644@@ -1,5 +1,5 @@ import { EMPTY_ARR } from '@vue/shared'-import { createApp, nextTick, reactive, ref } from '../src'+import { createApp, nextTick, reactive, ref, shallowRef } from '../src' describe('compiler + runtime integration', () => { it('should support runtime template compilation', () => {@@ -311,4 +311,67 @@ describe('compiler + runtime integration', () => { app.mount(root) expect(root.innerHTML).toBe('<div>60000000100000111</div>') })+ // scoped slot with a single array argument should receive the array as-is,+ // regardless of the slot outlet being rendered conditionally / in a loop+ describe('slot outlet with array v-bind', () => {+ const Parent = {+ template: `<Child v-slot="items"><span v-for="i in items">{{ i }}</span>|{{ Array.isArray(items) }}|</Child>`,+ }+ const mountWithChild = (childTemplate: string, state: any) => {+ const container = document.createElement('div')+ createApp({+ components: { Child: { template: childTemplate, setup: () => state } },+ ...Parent,+ }).mount(container)+ return container+ }++ test('without v-if', () => {+ const container = mountWithChild(`<slot v-bind="arr" />`, {+ arr: ['a', 'b'],+ })+ expect(container.innerHTML).toBe(`<span>a</span><span>b</span>|true|`)+ })++ test('with v-if', async () => {+ const ok = ref(true)+ const container = mountWithChild(+ `<slot v-if="ok" v-bind="arr" /><slot v-else v-bind="other" />`,+ { ok, arr: ['a', 'b'], other: ['c'] },+ )+ expect(container.innerHTML).toBe(`<span>a</span><span>b</span>|true|`)+ ok.value = false+ await nextTick()+ expect(container.innerHTML).toBe(`<span>c</span>|true|`)+ })++ test('with v-for', () => {+ const container = mountWithChild(+ `<slot v-for="g in groups" v-bind="g" />`,+ { groups: [['a', 'b'], ['c']] },+ )+ expect(container.innerHTML).toBe(+ `<span>a</span><span>b</span>|true|<span>c</span>|true|`,+ )+ })++ test('with keyed template v-for', async () => {+ const groups = shallowRef([+ { id: 1, items: ['a', 'b'] },+ { id: 2, items: ['c'] },+ ])+ const container = mountWithChild(+ `<template v-for="g in groups" :key="g.id"><slot v-bind="g.items" /></template>`,+ { groups },+ )+ expect(container.innerHTML).toBe(+ `<span>a</span><span>b</span>|true|<span>c</span>|true|`,+ )+ groups.value = groups.value.slice().reverse()+ await nextTick()+ expect(container.innerHTML).toBe(+ `<span>c</span>|true|<span>a</span><span>b</span>|true|`,+ )+ })+ }) })
packages/compiler-core/__tests__/transforms/__snapshots__/transformElement.spec.ts.snapindex 3da778eb6..c07237de2 100644@@ -121,6 +121,20 @@ return function render(_ctx, _cache) { }" `; +exports[`compiler: v-for > codegen > template v-for key injection with single slot child 1`] = `+"const _Vue = Vue++return function render(_ctx, _cache) {+ with (_ctx) {+ const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue++ return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {+ return _renderSlot($slots, "default", {}, undefined, undefined, item.id)+ }), 128 /* KEYED_FRAGMENT */))+ }+}"+`;+ exports[`compiler: v-for > codegen > template v-for w/ <slot/> 1`] = ` "const _Vue = Vue packages/compiler-core/__tests__/transforms/__snapshots__/vFor.spec.ts.snapindex 3da778eb6..c07237de2 100644@@ -121,6 +121,20 @@ return function render(_ctx, _cache) { }" `; +exports[`compiler: v-for > codegen > template v-for key injection with single slot child 1`] = `+"const _Vue = Vue++return function render(_ctx, _cache) {+ with (_ctx) {+ const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue++ return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {+ return _renderSlot($slots, "default", {}, undefined, undefined, item.id)+ }), 128 /* KEYED_FRAGMENT */))+ }+}"+`;+ exports[`compiler: v-for > codegen > template v-for w/ <slot/> 1`] = ` "const _Vue = Vue packages/compiler-core/__tests__/transforms/__snapshots__/vIf.spec.ts.snapindex 65ee73c46..ed2c8e540 100644@@ -80,7 +80,7 @@ return function render(_ctx, _cache) { const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue return ok- ? _renderSlot($slots, "default", { key: 0 })+ ? _renderSlot($slots, "default", {}, undefined, undefined, 0) : _createCommentVNode("v-if", true) } }"@@ -140,7 +140,21 @@ return function render(_ctx, _cache) { const { renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue return ok- ? _renderSlot($slots, "default", { key: 0 })+ ? _renderSlot($slots, "default", {}, undefined, undefined, 0)+ : _createCommentVNode("v-if", true)+ }+}"+`;++exports[`compiler: v-if > codegen > v-if on <slot/> with v-bind 1`] = `+"const _Vue = Vue++return function render(_ctx, _cache) {+ with (_ctx) {+ const { normalizeProps: _normalizeProps, guardReactiveProps: _guardReactiveProps, renderSlot: _renderSlot, createCommentVNode: _createCommentVNode } = _Vue++ return ok+ ? _renderSlot($slots, "default", _normalizeProps(_guardReactiveProps(items)), undefined, undefined, 0) : _createCommentVNode("v-if", true) } }"packages/compiler-core/__tests__/transforms/vFor.spec.tsindex 34991445c..839d9d358 100644@@ -918,6 +918,34 @@ describe('compiler: v-for', () => { expect(generate(root).code).toMatchSnapshot() }) + test('template v-for key injection with single slot child', () => {+ const {+ root,+ node: { codegenNode },+ } = parseWithForTransform(+ '<template v-for="item in items" :key="item.id"><slot/></template>',+ )+ expect(+ assertSharedCodegen(codegenNode, true, true /* custom return */),+ ).toMatchObject({+ source: { content: `items` },+ params: [{ content: `item` }],+ returns: {+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: RENDER_SLOT,+ arguments: [+ '$slots',+ '"default"',+ '{}',+ 'undefined',+ 'undefined',+ { content: 'item.id' },+ ],+ },+ })+ expect(generate(root).code).toMatchSnapshot()+ })+ // #1907 test('template v-for key injection with single child', () => { const {packages/compiler-core/__tests__/transforms/vIf.spec.tsindex fe3aef714..677f6b55b 100644@@ -3,6 +3,7 @@ import { transform } from '../../src/transform' import { transformIf } from '../../src/transforms/vIf' import { transformElement } from '../../src/transforms/transformElement' import { transformSlotOutlet } from '../../src/transforms/transformSlotOutlet'+import { transformBind } from '../../src/transforms/vBind' import { type CommentNode, type ConditionalExpression,@@ -509,7 +510,14 @@ describe('compiler: v-if', () => { expect(codegenNode.consequent).toMatchObject({ type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_SLOT,- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })],+ arguments: [+ '$slots',+ '"default"',+ '{}',+ 'undefined',+ 'undefined',+ { content: '0' },+ ], }) expect(generate(root).code).toMatchSnapshot() })@@ -522,7 +530,41 @@ describe('compiler: v-if', () => { expect(codegenNode.consequent).toMatchObject({ type: NodeTypes.JS_CALL_EXPRESSION, callee: RENDER_SLOT,- arguments: ['$slots', '"default"', createObjectMatcher({ key: `[0]` })],+ arguments: [+ '$slots',+ '"default"',+ '{}',+ 'undefined',+ 'undefined',+ { content: '0' },+ ],+ })+ expect(generate(root).code).toMatchSnapshot()+ })++ test('v-if on <slot/> with v-bind', () => {+ const {+ root,+ node: { codegenNode },+ } = parseWithIfTransform(`<slot v-if="ok" v-bind="items"></slot>`, {+ directiveTransforms: {+ bind: transformBind,+ },+ })+ expect(codegenNode.consequent).toMatchObject({+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: RENDER_SLOT,+ arguments: [+ '$slots',+ '"default"',+ {+ type: NodeTypes.JS_CALL_EXPRESSION,+ callee: NORMALIZE_PROPS,+ },+ 'undefined',+ 'undefined',+ { content: '0' },+ ], }) expect(generate(root).code).toMatchSnapshot() })packages/compiler-core/src/ast.tsindex e3cc5304d..e6da01edb 100644@@ -488,14 +488,29 @@ export interface DirectiveArgumentNode extends ArrayExpression { export interface RenderSlotCall extends CallExpression { callee: typeof RENDER_SLOT arguments:- // $slots, name, props, fallback+ // $slots, name, props, fallback, noSlotted, branchKey | [string, string | ExpressionNode]- | [string, string | ExpressionNode, PropsExpression]+ | [string, string | ExpressionNode, PropsExpression | '{}'] | [ string, string | ExpressionNode, PropsExpression | '{}',- TemplateChildNode[],+ FunctionExpression | string,+ ]+ | [+ string,+ string | ExpressionNode,+ PropsExpression | '{}',+ FunctionExpression | string,+ string,+ ]+ | [+ string,+ string | ExpressionNode,+ PropsExpression | '{}',+ FunctionExpression | string,+ string,+ JSChildNode, ] } packages/compiler-core/src/utils.tsindex aa426bbab..025f6c32d 100644@@ -392,6 +392,10 @@ export function injectProp( prop: Property, context: TransformContext, ): void {+ if (node.type !== NodeTypes.VNODE_CALL && injectSlotKey(node, prop)) {+ return+ }+ let propsWithInjection: ObjectExpression | CallExpression | undefined /** * 1. mergeProps(...)@@ -473,6 +477,36 @@ export function injectProp( } } +function injectSlotKey(node: RenderSlotCall, prop: Property): boolean {+ if (+ prop.key.type !== NodeTypes.SIMPLE_EXPRESSION ||+ prop.key.content !== 'key'+ ) {+ return false+ }++ // If the slot already has a user-provided key, avoid injecting the branch+ // key so the user key keeps its existing priority.+ const props = node.arguments[2]+ if (props && !isString(props)) {+ const [unnormalizedProps] = getUnnormalizedProps(props as PropsExpression)+ if (+ unnormalizedProps &&+ !isString(unnormalizedProps) &&+ unnormalizedProps.type === NodeTypes.JS_OBJECT_EXPRESSION &&+ hasProp(prop, unnormalizedProps)+ ) {+ return true+ }+ }++ node.arguments[2] ||= '{}'+ node.arguments[3] ||= 'undefined'+ node.arguments[4] ||= 'undefined'+ node.arguments[5] = prop.value+ return true+}+ // check existing key to avoid overriding user provided keys function hasProp(prop: Property, props: ObjectExpression) { let result = falsepackages/runtime-core/__tests__/helpers/renderSlot.spec.tsindex bc0678b51..f359f431c 100644@@ -38,6 +38,83 @@ describe('renderSlot', () => { expect(vnode.key).toBe('_default') }) + it('should allow symbol values for compiler-injected slot keys', () => {+ const key = Symbol()+ const vnode = renderSlot(+ { default: () => [h('div')] },+ 'default',+ {},+ undefined,+ undefined,+ key,+ )+ expect(vnode.key).toBe('_default')+ })++ it('should not expose compiler-injected slot keys to slot props', () => {+ let receivedProps: any+ const props = ['foo', 'bar']+ const vnode = renderSlot(+ {+ default: props => {+ receivedProps = props+ return [h('div')]+ },+ },+ 'default',+ props as any,+ undefined,+ undefined,+ 'branch',+ )++ expect(receivedProps).toBe(props)+ expect(receivedProps).not.toHaveProperty('key')+ expect(vnode.key).toBe('branch')+ })++ it('should prefer user-provided slot prop keys over compiler-injected keys', () => {+ let receivedProps: any+ const props = { key: 'user' }+ const vnode = renderSlot(+ {+ default: props => {+ receivedProps = props+ return [h('div')]+ },+ },+ 'default',+ props,+ undefined,+ undefined,+ 'branch',+ )++ expect(receivedProps).toBe(props)+ expect(vnode.key).toBe('user')+ })++ it('should preserve compiler-injected slot keys in custom element mode', () => {+ setCurrentRenderingInstance({ type: {}, ce: {} } as any)++ let vnode = renderSlot({}, 'default', {}, undefined, undefined, 0)+ let slot = (vnode.children as any[])[0]+ expect(slot.type).toBe('slot')+ expect(slot.key).toBe(0)+ expect(vnode.patchFlag).toBe(PatchFlags.BAIL)++ vnode = renderSlot(+ {},+ 'default',+ { key: 'user' },+ undefined,+ undefined,+ 'branch',+ )+ slot = (vnode.children as any[])[0]+ expect(slot.key).toBe('user')+ })+ it('should render slot fallback', () => { const vnode = renderSlot({}, 'default', { key: 'foo' }, () => ['fallback']) expect(vnode.children).toEqual(['fallback'])packages/runtime-core/src/helpers/renderSlot.tsindex 8f65f8af4..2a68ee3e4 100644@@ -16,7 +16,7 @@ import { isVNode, openBlock, } from '../vnode'-import { PatchFlags, SlotFlags, isSymbol } from '@vue/shared'+import { PatchFlags, SlotFlags, extend, isSymbol } from '@vue/shared' import { warn } from '../warning' import { isAsyncWrapper } from '../apiAsyncComponent' @@ -32,6 +32,7 @@ export function renderSlot( // the compiler and guaranteed to be a function returning an array fallback?: () => VNodeArrayChildren, noSlotted?: boolean,+ branchKey?: PropertyKey, ): VNode { if ( currentRenderingInstance!.ce ||@@ -39,17 +40,21 @@ export function renderSlot( isAsyncWrapper(currentRenderingInstance!.parent) && currentRenderingInstance!.parent.ce) ) {- const hasProps = Object.keys(props).length > 0+ const slotProps =+ branchKey != null && props.key == null+ ? extend({}, props, { key: branchKey })+ : props+ const hasProps = Object.keys(slotProps).length > 0 // in custom element mode, render <slot/> as actual slot outlets // wrap it with a fragment because in shadowRoot: false mode the slot // element gets replaced by injected content- if (name !== 'default') props.name = name+ if (name !== 'default') slotProps.name = name return ( openBlock(), createBlock( Fragment, null,- [createVNode('slot', props, fallback && fallback())],+ [createVNode('slot', slotProps, fallback && fallback())], hasProps ? PatchFlags.BAIL : PatchFlags.STABLE_FRAGMENT, ) )@@ -80,6 +85,7 @@ export function renderSlot( const validSlotContent = slot && ensureValidVNode(slot(props)) const slotKey = props.key ||+ branchKey || // 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)