fix(runtime-core): fix user attched public instance properties that start with "$"

This commit is contained in:
Evan You
2020-04-17 10:23:10 -04:00
parent 99fd158d09
commit d7ca1c5c6e
2 changed files with 9 additions and 0 deletions

View File

@@ -184,6 +184,10 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
(cssModule = cssModule[key])
) {
return cssModule
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
// user may set custom properties to `this` that start with `$`
accessCache![key] = AccessTypes.CONTEXT
return ctx[key]
} else if (
// global properties
((globalProperties = appContext.config.globalProperties),