Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple apps #2

Closed
skirtles-code opened this issue Jun 26, 2021 · 2 comments
Closed

Add support for multiple apps #2

skirtles-code opened this issue Jun 26, 2021 · 2 comments

Comments

@skirtles-code
Copy link

service.ts shares container, node and instance between usages. This causes problems if the plugin is installed on multiple apps. e.g.:

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.

@Subwaytime
Copy link
Owner

Subwaytime commented Jun 29, 2021

Thanks for reporting this! Havent looked into multiple instance support by now, but should be fairly easy to resolve!

@Subwaytime
Copy link
Owner

fixed with version v0.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants