Skip to content

Commit

Permalink
fix(runtime-core): props should be readonly via direct template access
Browse files Browse the repository at this point in the history
  • Loading branch information
buqiyuan committed May 25, 2024
1 parent a036021 commit 07b490c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 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 All @@ -48,7 +49,6 @@ export function renderComponentRoot(
vnode,
proxy,
withProxy,
props,
propsOptions: [propsOptions],
slots,
attrs,
Expand All @@ -60,10 +60,11 @@ export function renderComponentRoot(
ctx,
inheritAttrs,
} = instance
const props = __DEV__ ? shallowReadonly(instance.props) : instance.props
const prev = setCurrentRenderingInstance(instance)

let result
let fallthroughAttrs
const prev = setCurrentRenderingInstance(instance)
if (__DEV__) {
accessedAttrs = false
}
Expand Down

0 comments on commit 07b490c

Please sign in to comment.