question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

instance method do not work on functional component... i.e Can't use vue-i18n inside

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
yyx990803commented, Apr 23, 2018

Use parent.$t

2reactions
posvacommented, Apr 23, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found