fix #3437 properly without hacking the type system

This commit is contained in:
Evan You 2016-08-12 16:33:21 -05:00
parent 9bbf7230a5
commit a5a501eafb
1 changed files with 2 additions and 3 deletions

View File

@ -126,7 +126,7 @@ export function createComponentInstanceForVnode (
}
function init (vnode: VNodeWithData, hydrating: boolean) {
if (!vnode.child) {
if (!vnode.child || vnode.child._isDestroyed) {
const child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance)
child.$mount(hydrating ? vnode.elm : undefined, hydrating)
}
@ -157,11 +157,10 @@ function insert (vnode: MountedComponentVNode) {
}
}
function destroy (vnode: any) {
function destroy (vnode: MountedComponentVNode) {
if (!vnode.child._isDestroyed) {
if (!vnode.data.keepAlive) {
vnode.child.$destroy()
vnode.child = null
} else {
vnode.child._inactive = true
callHook(vnode.child, 'deactivated')