Skip to content

Commit ce01f46

Browse files
committed
chore(docs): update collection page recipe
Signed-off-by: Frederik Bußmann <frederik@bussmann.io>
1 parent 6079cc5 commit ce01f46

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

docs/app/components/recipes/CollectionPage.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ const { data: collection } = await useStorefrontData(key, `#graphql
3939
before: route.query.before,
4040
})),
4141
transform: data => data.collection,
42-
watch: [
43-
() => route.query.after,
44-
() => route.query.before,
45-
],
4642
})
4743
4844
const products = computed(() => flattenConnection(collection.value?.products))
@@ -76,6 +72,7 @@ const hasNextPage = computed(() => collection.value?.products.pageInfo.hasNextPa
7672
v-if="hasPreviousPage"
7773
:to="`?before=${startCursor}`"
7874
icon="i-lucide-arrow-left"
75+
external
7976
>
8077
Previous
8178
</UButton>
@@ -84,6 +81,7 @@ const hasNextPage = computed(() => collection.value?.products.pageInfo.hasNextPa
8481
v-if="hasNextPage"
8582
:to="`?after=${endCursor}`"
8683
trailing-icon="i-lucide-arrow-right"
84+
external
8785
>
8886
Next
8987
</UButton>

docs/content/3.recipes/2.collection-page.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ This recipe will show you how to create a collection page for your Shopify store
6464
before: route.query.before,
6565
},
6666
transform: data => data.collection,
67-
watch: [
68-
() => route.query.after,
69-
() => route.query.before,
70-
],
67+
watch: [ () => route.query ],
7168
})
7269

7370
const products = computed(() => flattenConnection(collection.value?.products))

0 commit comments

Comments
 (0)