0

So I made my site using Prismic/GraphQL and Gridsome. And I got the query working, only that when rendering the strings to the rendered string shows   where only spaces would go.

Im using v-html to render the string. I even tried to format it but it seems to me like im missing something?

<p v-for="(p, index) in $page.prismicio.post.edges[0].node.content" :key="index" v-html="p.text" />

My graphQl is just the basic variant:

<page-query>
query Post ($uid: String!) {
  prismicio {
    post: allNewss(uid: $uid) {
      edges {
        node {
          _meta {
            id
            uid
          }
          title
          date
          description
          content
          image
        }
      }
    }
  }
}
</page-query>

And this is part what is output in grahQL explorer:

 "content": [
              {
                "type": "paragraph",
                "text": "Lectus hendrerit curae nostra.",
                "spans": []
              },
...

but the actual output is this:

Lectus&nbsp;hendrerit&nbsp;curae&nbsp;nostra.
Bravebox
  • 33
  • 6
  • Why you use v-HTML? (Your text is a regular string "hello", not HTML "

    hello

    "). Try v-text or use “Mustache” syntax. Works fine to me (witout primisic) - maybe this Q is relevant: https://stackoverflow.com/questions/30877491/display-unescaped-html-in-vue-js
    – Ezra Siton Mar 04 '20 at 13:29
  • Thanks for your comment, however, with {{}} and v-text I get the same result, it renders the string with   – Bravebox Mar 05 '20 at 14:12

0 Answers0