Repository navigation
fix(compiler-ssr): allow keyed children in v-for slots without slot props - #15891
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
A component whose dynamic slots are rendered with
v-forfails to compile for SSR when the slot has no props and its child has akey:The client compiler accepts this template, and so does the SSR compiler once the slot declares props. Without props, SSR reports
<template v-for> key should be placed on the <template> tag. To build the vnode fallback branch, the SSR compiler wraps the slot children in a<template>that getsv-slotonly when the slot has props, so the v-for transform treats the wrapper as a<template v-for>fragment. Real example: vue3-ele-formEleFormInput.vue.Playground
Summary by CodeRabbit
v-forwithout slot props, preventing keyed children from generating incorrect context references and ensuring valid compilation.