fix(runtime-core): should not cache property access during data() invocation (#3299)
fix #3297
This commit is contained in:
@@ -31,7 +31,7 @@ import {
|
||||
OptionTypesType,
|
||||
OptionTypesKeys,
|
||||
resolveMergedOptions,
|
||||
isInBeforeCreate
|
||||
shouldCacheAccess
|
||||
} from './componentOptions'
|
||||
import { EmitsOptions, EmitFn } from './componentEmits'
|
||||
import { Slots } from './componentSlots'
|
||||
@@ -305,7 +305,7 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
|
||||
} else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
|
||||
accessCache![key] = AccessTypes.CONTEXT
|
||||
return ctx[key]
|
||||
} else if (!__FEATURE_OPTIONS_API__ || !isInBeforeCreate) {
|
||||
} else if (!__FEATURE_OPTIONS_API__ || shouldCacheAccess) {
|
||||
accessCache![key] = AccessTypes.OTHER
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user