File tree Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Expand file tree Collapse file tree 1 file changed +1
-31
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" container mx-auto" >
3
- <div class =" flex flex-wrap" >
4
- Hei!
5
- <ProductsShowAll />
6
- Filter:
7
- <ProductFilter />
8
- <div class =" w-full md:w-3/4 p-4" >
9
- <template v-if =" pending " >
10
- <SpinnerLoading />
11
- </template >
12
- <template v-else-if =" error " >
13
- <p >Error loading products.</p >
14
- </template >
15
- <template v-else >
16
- <ProductGrid :products =" store.filteredProducts" />
17
- </template >
18
- </div >
19
- </div >
20
- </div >
2
+ <ProductsShowAll />
21
3
</template >
22
4
23
5
<script setup>
24
- import { useProductsStore } from " @/store/useProductsStore" ;
25
- import FETCH_ALL_PRODUCTS_QUERY from " @/apollo/queries/FETCH_ALL_PRODUCTS_QUERY.gql" ;
26
-
27
- const store = useProductsStore ();
28
-
29
- const { data , pending , error } = await useAsyncQuery (FETCH_ALL_PRODUCTS_QUERY );
30
-
31
- if (data .value ) {
32
- store .products = data .value .products .nodes ;
33
- store .productTypes = store .getUniqueProductTypes ;
34
- }
35
-
36
6
useHead ({
37
7
title: " Products" ,
38
8
titleTemplate: " %s - Nuxt 3 Woocommerce" ,
You can’t perform that action at this time.
0 commit comments