Browse Source

test: fix options usage of reactive

Evan You 6 years ago
parent
commit
5d952cc051
1 changed files with 3 additions and 2 deletions
  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