Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,11 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
} else if (hasSetupBinding(setupState, key)) {
accessCache![key] = AccessTypes.SETUP
return setupState[key]
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
} else if (
__FEATURE_OPTIONS_API__ &&
data !== EMPTY_OBJ &&
hasOwn(data, key)
) {
accessCache![key] = AccessTypes.DATA
return data[key]
} else if (
Expand Down Expand Up @@ -545,7 +549,11 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
) {
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`)
return false
} else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
} else if (
__FEATURE_OPTIONS_API__ &&
data !== EMPTY_OBJ &&
hasOwn(data, key)
) {
data[key] = value
return true
} else if (hasOwn(instance.props, key)) {
Expand Down Expand Up @@ -582,7 +590,10 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
let normalizedProps, cssModules
return !!(
accessCache![key] ||
(data !== EMPTY_OBJ && key[0] !== '$' && hasOwn(data, key)) ||
(__FEATURE_OPTIONS_API__ &&
data !== EMPTY_OBJ &&
key[0] !== '$' &&
hasOwn(data, key)) ||
hasSetupBinding(setupState, key) ||
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
hasOwn(ctx, key) ||
Expand Down
Loading