How to access $t() inside script? #825
Answered
by
kazupon
LifeIsStrange
asked this question in
Q&A
-
I can access $t() in the template of a SFC component but for some reason, it is undefined in the component script... |
Beta Was this translation helpful? Give feedback.
Answered by
kazupon
Dec 10, 2021
Replies: 1 comment 1 reply
-
you need to use the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LifeIsStrange
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need to use the
useI18n
in script setup.You can check the vue-i18n-next docs
https://vue-i18n.intlify.dev/guide/advanced/composition.html