diff --git a/packages/runtime-core/src/components/KeepAlive.ts b/packages/runtime-core/src/components/KeepAlive.ts index ead43717..8301185d 100644 --- a/packages/runtime-core/src/components/KeepAlive.ts +++ b/packages/runtime-core/src/components/KeepAlive.ts @@ -226,7 +226,7 @@ const KeepAliveImpl = { keys.add(key) // prune oldest entry if (max && keys.size > parseInt(max as string, 10)) { - pruneCacheEntry(Array.from(keys)[0]) + pruneCacheEntry(keys.values().next().value) } } // avoid vnode being unmounted