Nuxt 3 - Prismic not pulling the data

Hi im kind a confuse it seems im getting errors and not fetching any data from prismic.
may i know how to fix this.
Below is my github file

Hi @vickywitvicky,

I took a look and you just need to modify what you're putting into the getByUID helper function. Here are the docs for query helpers.

When you use getByUID, the first parameter is the id of your custom type. In your case: "homemain". Then the second parameter is the uid that you added in Prismic. In your case: "home". So the query should look something like this:

client.getByUID("homemain", "home")

Give that a try and let me know if it works for you. And let me know if you have any questions about this or anything else.

Cheers,
Levi

Hi Mr @Levi
Thank you very much another thing how to implement items from Repeatable Zone
Let say i have create slice.items[i].image and below code using Nuxt image sorry

<div v-for="(imageSource, index) in imageSources"  :key="index" > 
<NuxtImg   src="" /> 
</div>

thank you

Hi @vickywitvicky ,

To template your repeatable images, you can use PrismicImage and a for loop like you suggested:

<div
  v-for="item in slice.items"
  :key="item.image.url ?? undefined"
>
  <PrismicImage :field="item.image" />
</div>

Thanks.

1 Like

Hi Mr @Phil
Thank you very much its solve the problem.

1 Like

And one last thing Mr @Phil sorry for the rookie questions,
if i wanted to download image from prismic let say i have upload an image called imaginary.jpg then i wanted to download the image as it is with the same ext (jpg) using download button is it possible to do so or not something like unsplash when click you can download.

You can make a vue download button and pass the image URL from prismic to that button and make sure to append the image format to the image URL string so you have the format you want:

Thank you very much Mr @Phil. I will try.

1 Like