Reputation: 1564
i am using nuxtjs/i18n in typescript and i've added its types in TS config :
{
"compilerOptions": {
"types": [
"@nuxt/types",
"@nuxtjs/i18n",
]
}
}
But in componnets when i want to use
this.$i18n.locales
i have this error
so , How can I fix types error for @nuxt/i18n ?
Upvotes: 0
Views: 1310
Reputation: 69
Try something like this:
import { LocaleObject } from '@nuxtjs/i18n'
...
(this.$i18n.locales as LocaleObject[])
Upvotes: 1