فهرست منبع

fix(runtime-vapor): avoid mutating shared interop bridge

daiwei 2 هفته پیش
والد
کامیت
30b2b998fd
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      packages/runtime-vapor/src/vdomInterop.ts

+ 3 - 1
packages/runtime-vapor/src/vdomInterop.ts

@@ -1754,7 +1754,9 @@ export const vaporInteropPlugin: Plugin = app => {
   }
   setInteropEnabled()
   const internals = ensureRenderer().internals
-  app._context.vapor = extend(vaporInteropImpl, {
+  // Keep the shared base implementation immutable; renderer-bound methods must
+  // be per-app so installing the plugin cannot overwrite another app's bridge.
+  app._context.vapor = extend({}, vaporInteropImpl, {
     vdomMount: createVDOMComponent.bind(null, internals),
     vdomUnmount: internals.umt,
     vdomSlot: renderVDOMSlot.bind(null, internals),