'Nuxt Seo and fetch method
I'm using fetch() method for retieve the data from an api, for seo purposes i'm retrieving the same info with asyncData() for use it in the head method.
My question is, there is no way to access the fetch method state inside the head to wait the retrieve of the data and just use one way to retrieve my info so i can remove the asyncdata call?
something like this:
head() {
if (!this.$fetchState.pending) {
return {
title: `${this.post.data.attributes.title}`,
meta: [
{
hid: "description",
name: `${this.event.data.attributes.title} - Estudios Claw`,
content: `${this.event.data.attributes.description}`,
},
],
};
}
},
thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
