From: Evan You Date: Fri, 2 Nov 2018 20:40:20 +0000 (+0900) Subject: chore: do not warn about reserved methods X-Git-Tag: v3.0.0-alpha.0~1055 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf6e49559a9a54971c5bb5a089469bb6d3db5846;p=thirdparty%2Fvuejs%2Fcore.git chore: do not warn about reserved methods --- diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index 80bd36cb80..e9cc3cadcb 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.`