$prismic object

This module globally injects a $prismic object, meaning that you can access it anywhere using this.$prismic. For plugins, asyncData, nuxtServerInit and middlewares, you can access it from context.$prismic.

Methods

asHtml(richText)

Similar to PrismicDOM.RichText.asHtml, except that you don't have to pass through linkResolver and htmlResolver functions, the ones you provided are injected.

  • richText
    • Type: Object (Prismic Rich Text field object)
    • required

asText(richText)

Similar to PrismicDOM.RichText.asText.

  • richText
    • Type: Object (Prismic Rich Text field object)
    • required

Similar to PrismicDOM.Link.url, except that you don't have to pass through a linkResolver function, the one you provided is injected.

  • link
    • Type: Object (Prismic Link field object)
    • required

asDate(date)

Similar to PrismicDOM.Date.

  • date
    • Type: String (Prismic Date field string)
    • required

linkResolver(doc)

This is the linkResolver function you provided to the module. See configuration.

More on link resolving on Prismic documentation.

htmlSerializer(type, element, content, children)

This is the htmlSerializer function you provided to the module. See configuration.

More on the HTML Serializer on Prismic documentation.

preview()

This method resolves a preview session. You might be interested to use it if you provide a custom preview page.

This method is only available when previews are enabled.

Properties

api

Contains current instance of the Prismic API, see fetching content examples or learn more on how to query the API on Prismic documentation.

predicates

Contains all Prismic predicates coming from prismic-javascript kit, see complete predicate reference on Prismic documentation.

dom

Gives your direct access to the prismic-dom library.