fix(runtime-vapor): ensure props are shallow reactive in VDOM component (#13502)

This commit is contained in:
edison 2025-06-26 15:34:47 +08:00 committed by GitHub
parent 2074d66c90
commit 280829bf73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import {
isEmitListener,
onScopeDispose,
renderSlot,
shallowReactive,
shallowRef,
simpleSetCurrentInstance,
} from '@vue/runtime-dom'
@ -163,7 +164,8 @@ function createVDOMComponent(
// overwrite how the vdom instance handles props
vnode.vi = (instance: ComponentInternalInstance) => {
instance.props = wrapper.props
// ensure props are shallow reactive to align with VDOM behavior.
instance.props = shallowReactive(wrapper.props)
const attrs = (instance.attrs = createInternalObject())
for (const key in wrapper.attrs) {