Access `$nuxtI18nSeo` through @nuxtjs/composition-api
See original GitHub issueHey guys,
I am trying to access $nuxtI18nSeo
from the setup method using useContext
from nuxt composition API but I can’t find a way to access it.
Any guesses?
UPDATE: I managed to access it with the following code… will that to what it’s supposed to do? Also is that the “correct” way to do that?
const { app: { i18n } } = useContext()
const seo = i18n.vm.$nuxtI18nSeo()
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Access $nuxtI18nSeo through @nuxtjs/composition-api #873
I am trying to access $nuxtI18nSeo from the setup method using useContext from nuxt composition API but I can't find a way to...
Read more >Nuxt Composition API
Vue 3 Composition API. Get all the Composition API features in Nuxt 2. ; SSR features. Additional helpers to interact with SSR. ;...
Read more >nuxt-i18n | Yarn - Package Manager
Integration with vue-i18n · Automatic routes generation and custom paths · Search Engine Optimization · Lazy-loading of translation messages · Redirection based on ......
Read more >Nuxt Composition API - Vue School Blog
In this article I want to introduce @nuxtjs/composition-api module that ... Now we can access it through $http property of Nuxt Context.
Read more >vue.js - Access Nuxt custom plugin from Composition API
I was able to get this to work via the Nuxt useContext() method: import { useContext } from '@nuxtjs/composition-api' export default ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bissolli I’m stuck with this same issue. For some reason, however, the solution you posted using
root.$nuxtI18nSeo()
doesn’t work for us. We get a “Cannot read property ‘req’ of undefined” error from .nuxt/nuxt-i18n/plugin.routing.js on line 167.Did you run into this same issue, or did it just work for you right away? We might just temporarily ditch the SEO tags for now as we move to composition API until we can get it all working.
True. There is no composition API added yet but it doesn’t crash at least.