I registered i18n in Nuxt. But I can use it without errors. Interpolation didn't see $t method. How can I fix it?
For types in templates I use only JsDoc
Compiling actually works, but I don't want to see the error
Error: Property '$t' does not exist on type 'CombinedVueInstance<{ openedSubMenuId: any; } & { openSub(id: any): void; closeSub(): void; } & { nav: NavItem[]; value: boolean; } & Vue, object, object, object, Record<never, any>>'
Nuxt config
export default {
head: {
title: 'nuxt-football',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
css: ['@/assets/scss/_vars.scss', '@/assets/scss/main.scss'],
styleResources: {
scss: ['./assets/scss/*.scss'],
},
plugins: [],
components: {
dirs: [
'~/components',
{
path: '~/components/App/',
},
],
},
buildModules: ['@nuxtjs/eslint-module'],
modules: [
'@nuxtjs/axios',
'@nuxtjs/pwa',
'@nuxtjs/style-resources',
'nuxt-i18n',
],
i18n: {
defaultLocale: 'ru',
locales: [
{
code: 'ru',
file: 'ru-Ru.js',
},
],
lazy: true,
langDir: 'lang/',
},
axios: {},
build: {},
};
You need to add it to tsconfig (if you are using nuxt):