Sfoglia il codice sorgente

test: fix options usage of reactive

Evan You 6 anni fa
parent
commit
5d952cc051
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  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