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 a09e006 commit fbb4f1aCopy full SHA for fbb4f1a
packages/runtime-vapor/src/components/KeepAlive.ts
@@ -225,11 +225,14 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
225
})
226
227
let children = slots.default()
228
- if (isArray(children) && children.length > 1) {
229
- if (__DEV__) {
230
- warn(`KeepAlive should contain exactly one component child.`)
+ if (isArray(children)) {
+ children = children.filter(child => !(child instanceof Comment))
+ if (children.length > 1) {
231
+ if (__DEV__) {
232
+ warn(`KeepAlive should contain exactly one component child.`)
233
+ }
234
+ return children
235
}
- return children
236
237
238
// inject hooks to DynamicFragment to cache components during updates
0 commit comments