nuxt-modules / prismic

Easily connect your Nuxt.js application to your content hosted on Prismic
https://prismic.nuxtjs.org
MIT License
245 stars 48 forks source link

asHTML serializer doesn't work #197

Closed luca-smartpricing closed 1 year ago

luca-smartpricing commented 1 year ago

asHTML serializer doesn't work on nuxtjs/prismic: v3.0.0

Versions

Reproduction

https://stackblitz.com/edit/nuxt-starter-pzgnkr?file=app.vue

lihbr commented 1 year ago

Hey there, thank you so much for contributing and for the nice reproduction!

This turned out to be an upstream bug with @prismicio/vue, I fixed it in 4.0.1: https://github.com/prismicio/prismic-vue/commit/dfc0558df0746e6a8fcd847b1d646136f12c31ab

You should be able to get this fix by running npm update @prismicio/vue

Find this updated Stackblitz: https://stackblitz.com/edit/nuxt-starter-ehraxb?file=app.vue

Just a FYI also, since the Prismic plugin is also injected in Vue context, you can access it in the template through $prismic, allowing you to skip calling usePrismic() in your setup if you only need it there~

Let me know if anything!

luca-smartpricing commented 1 year ago

Yes, in my project yarn up @prismicio/vue -R works! Thank you! In your example you used $asHTML. This doesn't work. Instead as you said, $prismic.asHTML work fine.

lihbr commented 1 year ago

Oh yeah, my bad for the example, went too fast, updated it ☺️