Rewritten this question as was not clear.
I am using Prismic and I've been able to pull blog posts on the page with prismic-javascript in my Nuxt project.
This is what I have at the moment:
<section v-for="(post, i) in blogPosts" :key="i">
{{ blogPosts[i].data.post_title[0].text }}
{{ blogPosts[i].data.post_content[0].text }}
<img :src="blogPosts[i].data.post_image.url" :width="blogPosts[i].data.post_image.dimensions.width">
</section>
However, I am not sure how to drop a Prismic RichText render string into the v-for, like this one:
PrismicDOM.RichText.asHtml(blogPosts[i].data.post_content, linkResolver, htmlSerializer)
I am able to do that outside of the v-for, creating a variable, even if - and this might be a separate problem - I get all the html rendered as normal text, not tags.
I followed this "tutorial" but I am also not getting updated content from the blog despite the async/await (maybe I am missing something with this too)
Here's the rest of the code to get the posts:
async asyncData() {
const api = await Prismic.getApi(apiEndpoint, { accessToken: apiToken })
let blogPosts = {}
const response = await api.query(
Prismic.Predicates.at('document.type', 'blog-post')
)
blogPosts = response.results
)
return {
blogPosts
}
}
Thanks for your answers, hope it can also help / clarify it for others too.