fix create hooks duplicate invocation

This commit is contained in:
Evan You 2016-04-20 22:33:07 -04:00
parent 3f2fb1fb03
commit 48a5b429c0
2 changed files with 4 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}
}