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

fix(KeepAlive): correct condition for caching inner blocks to handle null cases

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

+ 1 - 1
packages/runtime-vapor/src/components/KeepAlive.ts

@@ -126,7 +126,7 @@ export const VaporKeepAliveImpl: ObjectVaporComponent = defineVaporComponent({
 
     const processFragment = (frag: DynamicFragment) => {
       const [innerBlock, interop] = getInnerBlock(frag.nodes)
-      if (!innerBlock && !shouldCache(innerBlock!, props, interop)) return
+      if (!innerBlock || !shouldCache(innerBlock!, props, interop)) return
 
       if (interop) {
         if (cache.has(innerBlock.vnode!.type)) {