diff --git a/hooks/src/index.js b/hooks/src/index.js index 40e1366cb0..d51517f9bc 100644 --- a/hooks/src/index.js +++ b/hooks/src/index.js @@ -125,6 +125,7 @@ options.unmount = vnode => { hasErrored = e; } }); + c.__hooks = undefined; if (hasErrored) options._catchError(hasErrored, c._vnode); } }; diff --git a/mangle.json b/mangle.json index 3f0bcc8dcf..26be490c61 100644 --- a/mangle.json +++ b/mangle.json @@ -25,6 +25,7 @@ "props": { "cname": 6, "props": { + "$_listeners": "l", "$_cleanup": "__c", "$__hooks": "__H", "$_list": "__", diff --git a/src/diff/index.js b/src/diff/index.js index 616bd93ae9..390a4a8d64 100644 --- a/src/diff/index.js +++ b/src/diff/index.js @@ -512,6 +512,7 @@ export function unmount(vnode, parentVNode, skipRemove) { } r.base = r._parentDom = null; + vnode._component = undefined; } if ((r = vnode._children)) { @@ -522,11 +523,13 @@ export function unmount(vnode, parentVNode, skipRemove) { } } - if (!skipRemove && vnode._dom != null) removeNode(vnode._dom); + if (!skipRemove && vnode._dom != null) { + removeNode(vnode._dom); + } // Must be set to `undefined` to properly clean up `_nextDom` // for which `null` is a valid value. See comment in `create-element.js` - vnode._dom = vnode._nextDom = undefined; + vnode._parent = vnode._dom = vnode._nextDom = undefined; } /** The `.render()` method for a PFC backing instance. */