]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: fix not saving cached computed options
authorEvan You <yyx990803@gmail.com>
Tue, 25 Sep 2018 17:49:09 +0000 (13:49 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 25 Sep 2018 17:49:09 +0000 (13:49 -0400)
packages/core/src/componentComputed.ts
packages/core/src/componentUtils.ts

index 04d9ccd18f9c411fd0137f3a53d497bed0e8172f..4c1a9c830a98fe96f877ea424925021e8c99ef84 100644 (file)
@@ -25,6 +25,7 @@ export function getComputedOptions(
       // as it's already defined on the prototype
     }
   }
+  extractionCache.set(comp, computedOptions)
   return computedOptions
 }
 
index 33e54b391c70bca08eb0457972d37949387e2802..fe191e16e3fc40ddbcc0bbb55d7e11dcee3d2fbe 100644 (file)
@@ -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)