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

fix create hooks duplicate invocation

Evan You пре 10 година
родитељ
комит
48a5b429c0
2 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 1
      src/runtime/vdom/component.js
  2. 0 1
      src/runtime/vdom/patch.js

+ 4 - 1
src/runtime/vdom/component.js

@@ -54,7 +54,10 @@ export default function Component (Ctor, data, parent, children) {
   }
 
   // return a placeholder vnode
-  const vnode = VNode('vue-component-' + Ctor.cid, data)
+  const id = `vue-component-${Ctor.cid}${
+    Ctor.options.name ? `-${Ctor.options.name}` : ''
+  }`
+  const vnode = VNode(id, data)
   vnode.componentOptions = { Ctor, propsData, listeners, parent, children }
   return vnode
 }

+ 0 - 1
src/runtime/vdom/patch.js

@@ -71,7 +71,6 @@ export default function createPatchFunction (backend) {
       // in that case we can just return the element and be done.
       if (isDef(i = vnode.child)) {
         invokeCreateHooks(vnode, insertedVnodeQueue)
-        invokeCreateHooks(i._vnode, insertedVnodeQueue)
         return vnode.elm
       }
     }