Преглед изворни кода

fix(runtime-vapor): simplify KeepAlive caching logic by removing redundant checks (#14217)

edison пре 4 месеци
родитељ
комит
624fa7e48c
1 измењених фајлова са 2 додато и 6 уклоњено
  1. 2 6
      packages/runtime-vapor/src/components/KeepAlive.ts

+ 2 - 6
packages/runtime-vapor/src/components/KeepAlive.ts

@@ -132,16 +132,12 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
         if (cache.has(innerBlock.vnode!.type)) {
           innerBlock.vnode!.shapeFlag! |= ShapeFlags.COMPONENT_KEPT_ALIVE
         }
-        if (shouldCache(innerBlock!, props, true)) {
-          innerBlock.vnode!.shapeFlag! |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
-        }
+        innerBlock.vnode!.shapeFlag! |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
       } else {
         if (cache.has(innerBlock!.type)) {
           innerBlock!.shapeFlag! |= ShapeFlags.COMPONENT_KEPT_ALIVE
         }
-        if (shouldCache(innerBlock!, props)) {
-          innerBlock!.shapeFlag! |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
-        }
+        innerBlock!.shapeFlag! |= ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE
       }
     }