Skip to content
Closed
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
12 changes: 8 additions & 4 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
isCompatEnabled,
warnDeprecation,
} from './compat/compatConfig'
import { shallowReadonly } from '@vue/reactivity'

/**
* dev only flag to track whether $attrs was used during render.
Expand Down Expand Up @@ -93,7 +94,7 @@ export function renderComponentRoot(
thisProxy,
proxyToUse!,
renderCache,
props,
__DEV__ ? shallowReadonly(props) : props,
setupState,
data,
ctx,
Expand All @@ -110,19 +111,22 @@ export function renderComponentRoot(
result = normalizeVNode(
render.length > 1
? render(
props,
__DEV__ ? shallowReadonly(props) : props,
__DEV__
? {
get attrs() {
markAttrsAccessed()
return attrs
return shallowReadonly(attrs)
},
slots,
emit,
}
: { attrs, slots, emit },
)
: render(props, null as any /* we know it doesn't need it */),
: render(
__DEV__ ? shallowReadonly(props) : props,
null as any /* we know it doesn't need it */,
),
)
fallthroughAttrs = Component.props
? attrs
Expand Down