Просмотр исходного кода

fix(runtime-vapor): clean up keptAliveScopes in pruneCacheEntry

daiwei 3 месяцев назад
Родитель
Сommit
2e78d1eb37
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      packages/runtime-vapor/src/components/KeepAlive.ts

+ 5 - 0
packages/runtime-vapor/src/components/KeepAlive.ts

@@ -327,6 +327,11 @@ const VaporKeepAliveImpl = defineVaporComponent({
       }
       }
       cache.delete(key)
       cache.delete(key)
       keys.delete(key)
       keys.delete(key)
+      const scope = keptAliveScopes.get(key)
+      if (scope) {
+        scope.stop()
+        keptAliveScopes.delete(key)
+      }
     }
     }
 
 
     // prune cache on include/exclude prop change
     // prune cache on include/exclude prop change