Closed skirtles-code closed 3 years ago
service.ts shares container, node and instance between usages. This causes problems if the plugin is installed on multiple apps. e.g.:
service.ts
container
node
instance
import { createApp } from 'vue' import { VueMountable } from 'vue-mountable' import App from './App.vue' const app = createApp(App) app.use(VueMountable) app.provide('msg', 'app1') app.mount('#app') const app2 = createApp(App) app2.use(VueMountable) app2.provide('msg', 'app2') app2.mount('#app2')
The functions provided by useComponent will then be bound to the second app in both cases. So, for example, attempting to inject the msg from inside a component mounted by VueMountable will always show app2, irrespective of which app it is in.
useComponent
inject
msg
VueMountable
app2
Thanks for reporting this! Havent looked into multiple instance support by now, but should be fairly easy to resolve!
multiple instance
fixed with version v0.0.5
service.ts
sharescontainer
,node
andinstance
between usages. This causes problems if the plugin is installed on multiple apps. e.g.:The functions provided by
useComponent
will then be bound to the second app in both cases. So, for example, attempting toinject
themsg
from inside a component mounted byVueMountable
will always showapp2
, irrespective of which app it is in.