feat: expose __vue__ in dev mode
This commit is contained in:
parent
3c49b30e17
commit
65033cec9d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user