Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with useAsyncData when use NuxtLInk #393

Open
minoo221 opened this issue Feb 22, 2024 · 0 comments
Open

Problem with useAsyncData when use NuxtLInk #393

minoo221 opened this issue Feb 22, 2024 · 0 comments
Labels
question Further information is requested

Comments

@minoo221
Copy link

minoo221 commented Feb 22, 2024

Hi, I don't know If the problem is with nuxt or nuxt/strapi plugin.
If I use <NuxtLink> like this:
<v-btn color="secondary" link :to="localePath({ name: 'sanitarne-kabinky-slug', params: { slug: product.attributes.slug } })" class="px-10" > Pozrieť produkt </v-btn>
I get error
image

It will happened when I load data like this:
const { data: products, refresh: refreshProducts } = await useAsyncData("sanitary-cabins", () => find<any>("sanitary-cabins", { populate: "*" }) );
but If load data like this:
const products = await find<any>("sanitary-cabins", { populate: "*" });
it works. This is how I display data in template:
<v-col cols="12" md="4" v-for="(product, index) in products?.data" :key="index"> <article> <v-img :src=" product.attributes.gallery.data != null ? store.getMediaUrl(product.attributes.gallery.data[0].attributes.formats.medium.url) : '' " width="100%" height="230px" cover class="mb-4" ></v-img> <h3 class="mb-4">{{ product.attributes.title }}</h3> <v-btn color="secondary" link :to="localePath({ name: 'sanitarne-kabinky-slug', params: { slug: product.attributes.slug } })" class="px-10" > Pozrieť produkt </v-btn> </article> </v-col>
Can anybody help?

@minoo221 minoo221 added the question Further information is requested label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant