]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(devtools): expose setupState target object
authorGuillaume Chau <guillaume.b.chau@gmail.com>
Sat, 22 Aug 2020 14:40:04 +0000 (16:40 +0200)
committerGuillaume Chau <guillaume.b.chau@gmail.com>
Sat, 22 Aug 2020 14:40:04 +0000 (16:40 +0200)
packages/runtime-core/src/component.ts

index 8f770f5a23b294213b06c1f049612430b34acc1a..c06b691b7bd750c5e82cf20f147fb5ffc712d4f2 100644 (file)
@@ -258,6 +258,11 @@ export interface ComponentInternalInstance {
    * @internal
    */
   setupState: Data
+  /**
+   * devtools access to additional info
+   * @internal
+   */
+  devtoolsRawSetupState?: any
   /**
    * @internal
    */
@@ -549,6 +554,9 @@ export function handleSetupResult(
     }
     // setup returned bindings.
     // assuming a render function compiled from template is present.
+    if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
+      instance.devtoolsRawSetupState = setupResult
+    }
     instance.setupState = proxyRefs(setupResult)
     if (__DEV__) {
       exposeSetupStateOnRenderContext(instance)