diff --git a/packages/core/src/createRenderer.ts b/packages/core/src/createRenderer.ts index aee6bd1c..c42a217a 100644 --- a/packages/core/src/createRenderer.ts +++ b/packages/core/src/createRenderer.ts @@ -1200,6 +1200,10 @@ export function createRenderer(options: RendererOptions) { instance.$vnode = renderInstanceRoot(instance) as MountedVNode mount(instance.$vnode, container, instance, isSVG, endNode) parentVNode.el = instance.$vnode.el + if (__DEV__) { + // expose __vue__ for devtools + ;(parentVNode.el as any).__vue__ = instance + } instance._mounted = true mountComponentInstanceCallbacks(instance, parentVNode.ref) } @@ -1242,6 +1246,11 @@ export function createRenderer(options: RendererOptions) { patch(prevVNode, nextVNode, container, instance, isSVG) const el = nextVNode.el as RenderNode + if (__DEV__) { + // expose __vue__ for devtools + ;(el as any).__vue__ = instance + } + // recursively update parentVNode el for nested HOCs if ((nextVNode.flags & VNodeFlags.PORTAL) === 0) { let vnode = instance.$parentVNode