We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c6ced5 commit 0ba9ef9Copy full SHA for 0ba9ef9
packages/compiler-vapor/src/transforms/vSlot.ts
@@ -90,12 +90,17 @@ function transformComponentSlot(
90
91
let slotKey
92
if (isTransitionNode(node) && nonSlotTemplateChildren.length) {
93
- const keyProp = findProp(
94
- nonSlotTemplateChildren[0] as ElementNode,
95
- 'key',
96
- ) as VaporDirectiveNode
97
- if (keyProp) {
98
- slotKey = keyProp.exp
+ const nonCommentChild = nonSlotTemplateChildren.find(
+ n => n.type !== NodeTypes.COMMENT,
+ )
+ if (nonCommentChild) {
+ const keyProp = findProp(
+ nonCommentChild as ElementNode,
99
+ 'key',
100
+ ) as VaporDirectiveNode
101
+ if (keyProp) {
102
+ slotKey = keyProp.exp
103
+ }
104
}
105
106
0 commit comments