2
0
Эх сурвалжийг харах

fix: fix not saving cached computed options

Evan You 7 жил өмнө
parent
commit
871947c25f

+ 1 - 0
packages/core/src/componentComputed.ts

@@ -25,6 +25,7 @@ export function getComputedOptions(
       // as it's already defined on the prototype
     }
   }
+  extractionCache.set(comp, computedOptions)
   return computedOptions
 }
 

+ 5 - 1
packages/core/src/componentUtils.ts

@@ -110,7 +110,11 @@ export function normalizeComponentRoot(
       componentVNode &&
       (flags & VNodeFlags.COMPONENT || flags & VNodeFlags.ELEMENT)
     ) {
-      if (inheritAttrs !== false && attrs !== void 0) {
+      if (
+        inheritAttrs !== false &&
+        attrs !== void 0 &&
+        Object.keys(attrs).length > 0
+      ) {
         vnode = cloneVNode(vnode, attrs)
       } else if (vnode.el) {
         vnode = cloneVNode(vnode)