File tree Expand file tree Collapse file tree 2 files changed +7
-19
lines changed
Expand file tree Collapse file tree 2 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 11<template >
2- <div v-if =" categories " >
2+ <div v-if =" data.productCategories " >
33 <section class =" mx-auto bg-white" >
44 <div
55 class =" grid gap-2 px-2 pt-2 pb-2 lg:px-0 xl:px-0 md:px-0 lg:grid-cols-4 sm:grid-cols-2 md:grid-cols-3 xs:grid-cols-3"
66 >
7- <template v-for =" nodes in categories " >
7+ <template v-for =" nodes in data . productCategories " >
88 <template v-for =" category in nodes " >
99 <div v-if =" category.slug !== undefined" :key =" category.id" >
1010 <NuxtLink
3333</template >
3434
3535<script setup>
36- defineProps ({
37- categories: {
38- type: [Object ],
39- required: true ,
40- },
41- });
36+ import FETCH_ALL_CATEGORIES_QUERY from " @/apollo/queries/FETCH_ALL_CATEGORIES_QUERY.gql" ;
37+
38+ const variables = { limit: 99 };
39+ const { data } = await useAsyncQuery (FETCH_ALL_CATEGORIES_QUERY , variables);
4240 </script >
Original file line number Diff line number Diff line change 11<template >
2- <div v-if =" data.productCategories" >
3- <CategoryShowAll :categories =" data.productCategories" />
4- </div >
5- <div v-else >
6- <SpinnerLoading />
7- </div >
2+ <CategoryShowAll />
83</template >
94
105<script setup>
11- import FETCH_ALL_CATEGORIES_QUERY from " @/apollo/queries/FETCH_ALL_CATEGORIES_QUERY.gql" ;
12-
13- const variables = { limit: 5 };
14- const { data } = await useAsyncQuery (FETCH_ALL_CATEGORIES_QUERY , variables);
15-
166useHead ({
177 title: " Categories" ,
188 titleTemplate: " %s - Nuxt 3 Woocommerce" ,
You can’t perform that action at this time.
0 commit comments