]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(vapor): special handling vapor props in vdom interop edison/fix/vdomInteropWithProps 13382/head
authordaiwei <daiwei521@126.com>
Mon, 26 May 2025 06:11:04 +0000 (14:11 +0800)
committerdaiwei <daiwei521@126.com>
Mon, 26 May 2025 07:21:58 +0000 (15:21 +0800)
packages-private/vapor-e2e-test/interop/VaporComp.vue
packages/runtime-vapor/src/vdomInterop.ts

index 88a60c782c091edc622eaaa07db174ecf7395900..f01565449193285822157f49371502b7700475ac 100644 (file)
@@ -27,7 +27,8 @@ const slotProp = ref('slot prop')
         change slot prop
       </button>
       <div class="vdom-slot-in-vapor-default">
-        #default: <slot :foo="slotProp" />
+        #default:
+        <slot :foo="slotProp" />
       </div>
       <div class="vdom-slot-in-vapor-test">
         #test: <slot name="test">fallback content</slot>
@@ -40,7 +41,7 @@ const slotProp = ref('slot prop')
     >
       Toggle default slot to vdom
     </button>
-    <VdomComp :msg="msg">
+    <VdomComp :msg="msg" class="foo">
       <template #default="{ foo }" v-if="passSlot">
         <div>slot prop: {{ foo }}</div>
         <div>component prop: {{ msg }}</div>
index 77228fd72a02fe85a5496daf7d89bc37e197a4d2..31f462e94abd653553698a29bcc12bccb57ecb7f 100644 (file)
@@ -151,7 +151,7 @@ function createVDOMComponent(
   const frag = new VaporFragment([])
   const vnode = createVNode(
     component,
-    rawProps && new Proxy(rawProps, rawPropsProxyHandlers),
+    rawProps && extend({}, new Proxy(rawProps, rawPropsProxyHandlers)),
   )
   const wrapper = new VaporComponentInstance(
     { props: component.props },