MCPcopy
hub / github.com/vuejs/core / pruneCacheEntry

Function pruneCacheEntry

packages/runtime-core/src/components/KeepAlive.ts:218–229  ·  view source on GitHub ↗
(key: CacheKey)

Source from the content-addressed store, hash-verified

216 }
217
218 function pruneCacheEntry(key: CacheKey) {
219 const cached = cache.get(key) as VNode
220 if (cached && (!current || !isSameVNodeType(cached, current))) {
221 unmount(cached)
222 } else if (current) {
223 // current active instance should no longer be kept-alive.
224 // we can't unmount it now but it might be later, so reset its flag now.
225 resetShapeFlag(current)
226 }
227 cache.delete(key)
228 keys.delete(key)
229 }
230
231 // prune cache on include/exclude prop change
232 watch(

Callers 2

pruneCacheFunction · 0.85
setupFunction · 0.85

Calls 4

isSameVNodeTypeFunction · 0.90
resetShapeFlagFunction · 0.85
unmountFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected