From 38ca7e8e4ebe46e53c3c4050ce2bb8161aeed633 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Sat, 29 Aug 2020 04:53:25 +0200 Subject: [PATCH] feat(devtools): expose vnode and component on elements --- packages/runtime-core/src/renderer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index 930464eb..ba8c8636 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -755,6 +755,10 @@ function baseCreateRenderer( hostSetScopeId(el, treeOwnerId + '-s') } } + if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { + el.__vnode = vnode + el.__vueParentComponent = parentComponent + } if (dirs) { invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount') }