File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
232232 return children
233233 }
234234
235+ // inject hooks to DynamicFragment to cache components during updates
235236 const injectKeepAliveHooks = ( frag : DynamicFragment ) => {
236237 ; ( frag . beforeTeardown || ( frag . beforeTeardown = [ ] ) ) . push (
237238 ( oldKey , nodes , scope ) => {
@@ -284,7 +285,7 @@ const shouldCache = (
284285 : ( block as GenericComponentInstance ) . type
285286 ) as GenericComponent & AsyncComponentInternalOptions
286287
287- // always cache unresolved async components
288+ // return true to ensure hooks are injected into its block (DynamicFragment)
288289 if ( isAsync && ! type . __asyncResolved ) {
289290 return true
290291 }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ export class DynamicFragment extends VaporFragment {
7070 fallback ?: BlockFn
7171 anchorLabel ?: string
7272
73- // get the scope for the current key when used in keep-alive
73+ // get the kept-alive scope when used in keep-alive
7474 getScope ?: ( key : any ) => EffectScope | undefined
7575
7676 // hooks
You can’t perform that action at this time.
0 commit comments