fix(devtools): make el extra properties non-enumerable

This commit is contained in:
Guillaume Chau 2020-08-29 05:00:38 +02:00
parent 38ca7e8e4e
commit 7fd3436290

View File

@ -756,8 +756,14 @@ function baseCreateRenderer(
} }
} }
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
el.__vnode = vnode Object.defineProperty(el, '__vnode', {
el.__vueParentComponent = parentComponent value: vnode,
enumerable: false
})
Object.defineProperty(el, '__vueParentComponent', {
value: parentComponent,
enumerable: false
})
} }
if (dirs) { if (dirs) {
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount') invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount')