()
| 242 | // cache sub tree after render |
| 243 | let pendingCacheKey: CacheKey | null = null |
| 244 | const cacheSubtree = () => { |
| 245 | // fix #1621, the pendingCacheKey could be 0 |
| 246 | if (pendingCacheKey != null) { |
| 247 | // if KeepAlive child is a Suspense, it needs to be cached after Suspense resolves |
| 248 | // avoid caching vnode that not been mounted |
| 249 | if (isSuspense(instance.subTree.type)) { |
| 250 | queuePostRenderEffect(() => { |
| 251 | cache.set(pendingCacheKey!, getInnerChild(instance.subTree)) |
| 252 | }, instance.subTree.suspense) |
| 253 | } else { |
| 254 | cache.set(pendingCacheKey, getInnerChild(instance.subTree)) |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | onMounted(cacheSubtree) |
| 259 | onUpdated(cacheSubtree) |
| 260 |
nothing calls this directly
no test coverage detected