prismicio / prismic-vue

Vue plugin, components, and composables to fetch and present Prismic content
https://prismic.io/docs/technologies/vuejs
Apache License 2.0
65 stars 16 forks source link

Example code for using components does only render first components #35

Closed supermueller closed 3 years ago

supermueller commented 4 years ago

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.

lihbr commented 3 years ago

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 🙂 6bfc2c7af7a3a4d10af8d02d2f7e2ff12f700bf4