From bf6e49559a9a54971c5bb5a089469bb6d3db5846 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 3 Nov 2018 05:40:20 +0900 Subject: [PATCH] chore: do not warn about reserved methods --- packages/runtime-core/src/componentProxy.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index 80bd36cb..e9cc3cad 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/packages/runtime-core/src/componentProxy.ts @@ -3,6 +3,7 @@ import { isFunction, isReservedKey } from '@vue/shared' import { warn } from './warning' import { isRendering } from './componentUtils' import { isObservable } from '@vue/observer' +import { reservedMethods } from '@vue/runtime-dom' const bindCache = new WeakMap() @@ -41,7 +42,12 @@ const renderProxyHandlers = { // hooks injections return i[key] } else if (key[0] !== '_') { - if (__DEV__ && isRendering && !(key in target)) { + if ( + __DEV__ && + isRendering && + !(key in target) && + !(key in reservedMethods) + ) { warn( `property "${key}" was accessed during render but does not exist ` + `on instance.`