instance method do not work on functional component... i.e Can't use vue-i18n inside
See original GitHub issueWhat problem does this feature solve?
currently I can’t use vue-i18n in functional components…
<div class="banner_dl columns">
<a
class="banner_dl_btn column is-narrow"
href=""
target="_blank"
rel="noopener noreferrer">
<img src="http://placehold.it/218x64" :alt="$t('buttons.download_android')">
</a>
<a
class="banner_dl_btn column is-narrow"
href=""
target="_blank"
rel="noopener noreferrer">
<img src="http://placehold.it/218x64" :alt="$t('buttons.download_ios')">
</a>
</div>
What does the proposed API look like?
there’s no API for that, it just have to work out-of-the-box
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Global method this.$t from vue-i18n does not work in function
If you move it inside methods then you have to call it via this.convertErrors (add a this. ) because it will be moved...
Read more >API references | Vue I18n
In Vue instance, If not specified component locale messages, check with global ... This is the same as the Function returned with $t...
Read more >Breaking Changes - Vue I18n
Vue I18n is no longer a class but a set of functions. Instead of writing new VueI18n() , you now have to call...
Read more >Advanced usage - Vuelidate
Instead, you have to use useVuelidate in your component's setup . ... accessing any of it's properties, like $error , $validate inside the...
Read more >Internationalization (i18n) — Vuetify
Vuetify is a Material Design component framework for Vue.js. ... hook into the internationalization engine, you can use the t function which is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Use parent.$t
The fact about
parent
, yes. But, it would be more helpful on vue-i18n docs. I don’t know if it’s there, but if it isn’t you should open a PR in their docs