prismicio / prismic-vue

Vue plugin, components, and composables to fetch and present Prismic content

Home Page:https://prismic.io/docs/technologies/vuejs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example code for using components does only render first components

supermueller opened this issue · comments

When following the usage instructions in the readme, the output is not as expected, because only the first vue component will be rendered.

The following code example is not easy to adapt, because of the missing closing tags. If you use the example for in-dom templating, only the first component will be rendered:

<template>
  <section>
    <prismic-image :field="fields.logo" />
    <prismic-rich-text :field="fields.title" />
    <prismic-rich-text :field="fields.somethingRich" />
  </section>
</template>

To work as in-dom template you have to add the closing tags:

<section>
  <prismic-image :field="fields.logo"></prismic-image>
  <prismic-rich-text :field="fields.title"></prismic-rich-text>
  <prismic-rich-text :field="fields.somethingRich"></prismic-rich-text>
</section>

Although self-closing tags are working in vue-template files (template.vue), it will be easier for newbies to adapt the example as in-dom templates.

commented

Hey @supermueller, I'm really sorry for the lack of support you got back then, thank you so much though for raising this to our attention. I added a small warning to prevent that 🙂 6bfc2c7