]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-vapor): ensure props are shallow reactive in VDOM component (#13502)
authoredison <daiwei521@126.com>
Thu, 26 Jun 2025 07:34:47 +0000 (15:34 +0800)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 07:34:47 +0000 (15:34 +0800)
packages/runtime-vapor/src/vdomInterop.ts

index b916a2c8ebb0106b1d7542db2a83c17005c2649e..e277024d73b6b22f169574ae2f049fa8013d42d5 100644 (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) {