Use $t function outside template
See original GitHub issueHi,
I’m trying to do simple alert( $t('error') )
in my JavaScript file but $t is undefined.
I’ve also tried Vue.$t
but it is also undefined.
Is there any way to use the $t function outside a template ?
Thank you, clem.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Vue i18n-$t undefined outside template - Stack Overflow
What I want is to change title using $t but when I do title:"$t('dash.pone')", I get $t not defined. How can I make...
Read more >Use $t function outside template #17 - Issuehunt
Hi,. I'm trying to do simple alert( $t('error') ) in my JavaScript file but $t is undefined. I've also tried Vue.$t but it...
Read more >Do you write the functions that aren't used in <template ...
I used to write ALL my functions inside methods: , even the functions I weren't using inside <template> . What about you?
Read more >Explicit (full) template specialization - cppreference.com
Explicit specialization may be declared in any scope where its primary template may be defined (which may be different from the scope where...
Read more >Templates, C++ FAQ
My template function does something special when the template type T is int or std::string ; how do I write my template so...
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 FreeTop 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
Top GitHub Comments
You can access translator globally like this:
I figured it out like this comment at issue #149