]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: update
authordaiwei <daiwei521@126.com>
Tue, 15 Apr 2025 03:47:54 +0000 (11:47 +0800)
committerdaiwei <daiwei521@126.com>
Tue, 15 Apr 2025 05:53:12 +0000 (13:53 +0800)
packages-private/vapor-e2e-test/package.json
packages/runtime-vapor/src/component.ts
packages/runtime-vapor/src/components/KeepAlive.ts

index d5d358f3cf1a08859f8c19e8d7f7c32e9df442b9..66ea0457ec9aa74c33524c12f75a6d5cb4521185 100644 (file)
@@ -5,7 +5,7 @@
   "type": "module",
   "scripts": {
     "dev": "vite dev",
-    "build": "vite build && vite preview"
+    "build": "vite build"
   },
   "devDependencies": {
     "@types/connect": "^3.4.38",
index e66d82b5c6b7930b36e910d3a9a7297059beaa4c..e7d9db5de6c3d13c87ed7a50397888ad5b992a70 100644 (file)
@@ -174,9 +174,9 @@ export function createComponent(
     )
     // TODO: problem is `frag.insert` will be called multiple times
     // if used in v-if
-    // if (!isHydrating && _insertionParent) {
-    //   insert(frag, _insertionParent, _insertionAnchor)
-    // }
+    if (!isHydrating && _insertionParent && !isKeepAlive(currentInstance)) {
+      insert(frag, _insertionParent, _insertionAnchor)
+    }
     return frag
   }
 
index 8ccc6d5538e0769c1ec0c7e0987ea782fd1f93e1..0674cd5a8ee7ebe198e4ac40768597b709f64e4a 100644 (file)
@@ -183,13 +183,11 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
     }
 
     function pruneCacheEntry(key: CacheKey) {
-      const cached = cache.get(key)
-      if (cached) {
-        resetShapeFlag(cached)
-        // don't unmount if the instance is the current one
-        if (cached !== current) {
-          remove(cached)
-        }
+      const cached = cache.get(key)!
+      resetShapeFlag(cached)
+      // don't unmount if the instance is the current one
+      if (cached !== current) {
+        remove(cached)
       }
       cache.delete(key)
       keys.delete(key)