Skip to content

Commit a5a501e

Browse files
committed
fix #3437 properly without hacking the type system
1 parent 9bbf723 commit a5a501e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/core/vdom/create-component.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function createComponentInstanceForVnode (
126126
}
127127

128128
function init (vnode: VNodeWithData, hydrating: boolean) {
129-
if (!vnode.child) {
129+
if (!vnode.child || vnode.child._isDestroyed) {
130130
const child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance)
131131
child.$mount(hydrating ? vnode.elm : undefined, hydrating)
132132
}
@@ -157,11 +157,10 @@ function insert (vnode: MountedComponentVNode) {
157157
}
158158
}
159159

160-
function destroy (vnode: any) {
160+
function destroy (vnode: MountedComponentVNode) {
161161
if (!vnode.child._isDestroyed) {
162162
if (!vnode.data.keepAlive) {
163163
vnode.child.$destroy()
164-
vnode.child = null
165164
} else {
166165
vnode.child._inactive = true
167166
callHook(vnode.child, 'deactivated')

0 commit comments

Comments
 (0)