Skip to content

Commit

Permalink
fix(devtools): expose root instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jun 7, 2021
1 parent ade9bd9 commit 2b52d5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
ConcreteComponent,
Data,
validateComponentName,
Component
Component,
ComponentInternalInstance
} from './component'
import {
ComponentOptions,
Expand Down Expand Up @@ -46,6 +47,7 @@ export interface App<HostElement = any> {
_props: Data | null
_container: HostElement | null
_context: AppContext
_instance: ComponentInternalInstance | null

/**
* v2 compat only
Expand Down Expand Up @@ -186,6 +188,7 @@ export function createAppAPI<HostElement>(
_props: rootProps,
_container: null,
_context: context,
_instance: null,

version,

Expand Down Expand Up @@ -296,6 +299,7 @@ export function createAppAPI<HostElement>(
;(rootContainer as any).__vue_app__ = app

if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
app._instance = vnode.component
devtoolsInitApp(app, version)
}

Expand All @@ -314,6 +318,7 @@ export function createAppAPI<HostElement>(
if (isMounted) {
render(null, app._container)
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
app._instance = null
devtoolsUnmountApp(app)
}
delete app._container.__vue_app__
Expand Down

0 comments on commit 2b52d5d

Please sign in to comment.