mirror of https://github.com/vuejs/core.git
fix(runtime-vapor): ensure props are shallow reactive in VDOM component (#13502)
This commit is contained in:
parent
2074d66c90
commit
280829bf73
|
@ -16,6 +16,7 @@ import {
|
||||||
isEmitListener,
|
isEmitListener,
|
||||||
onScopeDispose,
|
onScopeDispose,
|
||||||
renderSlot,
|
renderSlot,
|
||||||
|
shallowReactive,
|
||||||
shallowRef,
|
shallowRef,
|
||||||
simpleSetCurrentInstance,
|
simpleSetCurrentInstance,
|
||||||
} from '@vue/runtime-dom'
|
} from '@vue/runtime-dom'
|
||||||
|
@ -163,7 +164,8 @@ function createVDOMComponent(
|
||||||
|
|
||||||
// overwrite how the vdom instance handles props
|
// overwrite how the vdom instance handles props
|
||||||
vnode.vi = (instance: ComponentInternalInstance) => {
|
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())
|
const attrs = (instance.attrs = createInternalObject())
|
||||||
for (const key in wrapper.attrs) {
|
for (const key in wrapper.attrs) {
|
||||||
|
|
Loading…
Reference in New Issue