Helpers dont' work in template or head
sergiocerrutti opened this issue · comments
Hi James, thank you so much for this, it really speeds up the config between Nuxt and Prismic.
But I cannot use helpers outside asyncData (which gets $prismic from app), I get this error:
_vm.$prismic.asHtml is not a function
When I use the following in the template:
div.event__description__content(v-html="$prismic.asHtml(document.description)")
Also I get an error if I use these helpers in the compnent's head function.
Other things are working ok, I get the content from prismic and is rendered successfully without helpers.
Thank you so much in advance.
Ok my bad, I forgot to add the following to the htmlSerializer:
const Elements = PrismicDOM.RichText.Elements
I was using that way before implementing prismic-nuxt and I forgot to paste that line because it was out of the exported data. Thanks anyway!