File tree Expand file tree Collapse file tree 2 files changed +7
-16
lines changed
Expand file tree Collapse file tree 2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div v-if =" products" >
2+ <div v-if =" data?. products?.nodes " >
33 <section >
44 <div id =" product-container" class =" flex flex-wrap items-center" >
5- <template v-for =" product in products " >
5+ <template v-for =" product in data . products . nodes " >
66 <div
77 v-if =" product.slug !== undefined"
88 :key =" product.id"
5454</template >
5555
5656<script setup>
57+ import FETCH_ALL_PRODUCTS_QUERY from " @/apollo/queries/FETCH_ALL_PRODUCTS_QUERY.gql" ;
5758import { filteredVariantPrice } from " @/utils/functions" ;
5859
59- defineProps ({
60- products: { type: Array , required: true },
61- });
62-
6360const productImage = (product ) =>
6461 product .image ? product .image .sourceUrl : process .env .placeholderSmallImage ;
62+
63+ const variables = { limit: 99 };
64+ const { data } = await useAsyncQuery (FETCH_ALL_PRODUCTS_QUERY , variables);
6565 </script >
6666
6767<style scoped>
Original file line number Diff line number Diff line change 11<template >
22 <div >
33 <IndexHero />
4- <div v-if =" data.products" >
5- <ProductsShowAll :products =" data.products.nodes" />
6- </div >
4+ <ProductsShowAll />
75 </div >
86</template >
9-
10- <script setup>
11- import FETCH_ALL_PRODUCTS_QUERY from " @/apollo/queries/FETCH_ALL_PRODUCTS_QUERY.gql" ;
12-
13- const variables = { limit: 5 };
14- const { data } = await useAsyncQuery (FETCH_ALL_PRODUCTS_QUERY , variables);
15- </script >
You can’t perform that action at this time.
0 commit comments