我正在努力使用nuxtI18nHead
TypeScript,我应该怎么做才能避免这个错误?
以下来自default.vue
代码:
import MainNavbar from '~/components/MainNavbar.vue'
export default {
components: { MainNavbar },
head (): any {
return this.$nuxtI18nHead({ addSeoAttributes: true })
}
}
错误:
ERROR ERROR in layouts/default.vue:18:17 21:34:24
TS2339: Property '$nuxtI18nHead' does not exist on type '{ components: { MainNavbar: ExtendedVue<Vue, unknown, unknown, unknown, Record<never, any>>; }; head(): any; }'.
16 | components: { MainNavbar },
17 | head (): any {
> 18 | return this.$nuxtI18nHead({ addSeoAttributes: true })
| ^^^^^^^^^^^^^
19 | }
20 | }
21 |