fix(runtime-core): remove static node in production mode (#2556)

fix #2553
This commit is contained in:
underfin 2020-12-01 03:07:43 +08:00 committed by GitHub
parent 421205d0ad
commit 2a9ba0c8e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -650,9 +650,6 @@ function baseCreateRenderer(
hostInsert(end, container, anchor) hostInsert(end, container, anchor)
} }
/**
* Dev / HMR only
*/
const removeStaticNode = (vnode: VNode) => { const removeStaticNode = (vnode: VNode) => {
let cur = vnode.el let cur = vnode.el
while (cur && cur !== vnode.anchor) { while (cur && cur !== vnode.anchor) {
@ -2071,7 +2068,7 @@ function baseCreateRenderer(
return return
} }
if (__DEV__ && type === Static) { if (type === Static) {
removeStaticNode(vnode) removeStaticNode(vnode)
return return
} }