Quellcode durchsuchen

test: fix options usage of reactive

Evan You vor 6 Jahren
Ursprung
Commit
5d952cc051
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  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