Prechádzať zdrojové kódy

test: fix options usage of reactive

Evan You 6 rokov pred
rodič
commit
5d952cc051
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 3 2
      packages/runtime-core/src/apiOptions.ts

+ 3 - 2
packages/runtime-core/src/apiOptions.ts

@@ -249,8 +249,9 @@ export function applyOptions(
   } = options
 
   const renderContext =
-    instance.renderContext === EMPTY_OBJ
-      ? (instance.renderContext = {})
+    instance.renderContext === EMPTY_OBJ &&
+    (computedOptions || methods || watchOptions || injectOptions)
+      ? (instance.renderContext = reactive({}))
       : instance.renderContext
 
   const globalMixins = instance.appContext.mixins