mirror of https://github.com/vuejs/vue.git
fix #3437 properly without hacking the type system
This commit is contained in:
parent
9bbf7230a5
commit
a5a501eafb
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue