File tree Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Expand file tree Collapse file tree 1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,24 @@ const route = useRoute()
77const current = computed (() => route .path .split (' /' ).slice (- 1 )[0 ])
88
99const collections = computed (() => {
10- if (categorySearch .value ) {
11- return filteredCollections .value
12- }
13- else {
14- return [
15- { id: ' all' , name: ' All' },
16- { id: ' recent' , name: ' Recent' },
17- ... sortedCollectionsInfo .value ,
18- ]
19- }
10+ const _collections = categorySearch .value
11+ ? filteredCollections .value
12+ : [
13+ { id: ' all' , name: ' All' },
14+ { id: ' recent' , name: ' Recent' },
15+ ... sortedCollectionsInfo .value ,
16+ ]
17+
18+ return _collections .map (collection => ({
19+ ... collection ,
20+ to: {
21+ name: ' collection-id' ,
22+ params: { id: collection .id },
23+ query: {
24+ s: route .query .s ,
25+ },
26+ },
27+ }))
2028})
2129 </script >
2230
@@ -51,7 +59,7 @@ const collections = computed(() => {
5159 v-for =" collection in collections"
5260 :key =" collection.id"
5361 class =" px-3 py-1 flex border-b border-base"
54- :to =" `/ collection/${collection.id}` "
62+ :to =" collection.to "
5563 >
5664 <div
5765 class =" flex-auto py-1"
You can’t perform that action at this time.
0 commit comments