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

Is there any way to make injected properties local scope in Composition mode #994

Open
3 tasks done
LasyIsLazy opened this issue Apr 28, 2022 · 2 comments
Open
3 tasks done
Labels
Status: Proposal Request for comments

Comments

@LasyIsLazy
Copy link

Clear and concise description of the problem

For some reason, I have to use both Vue composition API and Vue legacy API in my project.

I prefer composition API, so I set legacy: false and globalInjection: true, i18n will be in Composition mode and I can use $i18n in code.

But $i18n.locale always refers to global scope locale, and I can't use local scope in Vue legacy code.

Suggested solution

Add some config to change injected properties's scope, when the Vue component have locale scope, injected properties can refers to local scope

Alternative

No response

Additional context

No response

Validations

@LasyIsLazy LasyIsLazy added the Status: Proposal Request for comments label Apr 28, 2022
@LasyIsLazy LasyIsLazy changed the title Is there any way to make injected properties locale scope in Composition mode Is there any way to make injected properties local scope in Composition mode Apr 28, 2022
@LasyIsLazy
Copy link
Author

Or maybe export some API that can access local i18n composer from Legacy Vue code

@LasyIsLazy
Copy link
Author

Additionally, $i18n refers to local scope when there is i18n option in Legacy mode.

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

No branches or pull requests

1 participant