Evan You 10 лет назад
Родитель
Сommit
79e164084b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      src/runtime/instance/proxy.js

+ 3 - 2
src/runtime/instance/proxy.js

@@ -16,13 +16,14 @@ if (process.env.NODE_ENV !== 'production') {
   proxyHandlers = {
     has (target, key) {
       const has = key in target
-      if (!has && !allowedGlobals(key)) {
+      const isAllowedGlobal = allowedGlobals(key)
+      if (!has && !isAllowedGlobal) {
         warn(
           `Trying to access non-existent property "${key}" while rendering.`,
           target
         )
       }
-      return has
+      return !isAllowedGlobal
     }
   }