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

feat: global props and methods injection for composable mode #122

Merged
merged 3 commits into from
Sep 25, 2020

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Sep 25, 2020

resolve #106

This PR is a PR to improve the DX of the API vue-i18n-next provides for the composition API.

This PR improves the following:

  • no longer needs to call useI18n on each component when using global composer
  • The following global props & methods are injected by app.config.globalProperties
    • $i18n prop: exported locale, fallbackLocale and availableLocales props
    • $t method
    • $d method
    • $n method
    • $tm method

@kazupon kazupon added the Type: Feature Includes new features label Sep 25, 2020
@ux-engineer
Copy link

Awesome! Just tomorrow I was refactoring components to Vue 3 and was wondering if I could use 't' easier way than importing and invoking useI18n()...

@kazupon kazupon merged commit 4f01902 into master Sep 25, 2020
@kazupon kazupon deleted the feat/global-injection branch September 25, 2020 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No transaltion for nested or child components
2 participants