3 Replies
Hi @Nawi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To use
tm
or rt
functions from vue-i18n with the items
prop in Nuxt UI components, you need to access the i18n instance within your component's setup function. Here's how you can do it:
1. First, import and use the useI18n
composable in your component:
2. Then, you can use these functions to create your items
array:
However, it's important to note that if you need to use these functions outside of the setup
function or in a store, you should use the useNuxtApp().$i18n
approach as mentioned in the Stack Overflow answer (https://stackoverflow.com/questions/77594888):
Remember that the exact implementation might vary depending on your specific Nuxt UI component and i18n setup. Always refer to the official Nuxt and vue-i18n documentation for the most up-to-date information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@969851557954879488> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
For example <UAccordion :items="tm('csCard.ctaList')" />
</UContainer>, where to rt?