@fy-/fws-vue 0.7.9 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,29 +42,22 @@ const next = () => {
42
42
  const page = props.items.page_no + 1;
43
43
 
44
44
  if (!isNewPage(page)) return;
45
-
45
+ const newQuery = { ...route.query };
46
+ newQuery.page = page.toString();
46
47
  history.push({
47
48
  path: history.currentRoute.path,
48
- query: { page: page.toString() },
49
+ query: newQuery,
49
50
  hash: props.hash != "" ? props.hash : undefined,
50
51
  });
51
52
  };
52
53
  const prev = () => {
53
54
  const page = props.items.page_no - 1;
54
55
  if (!isNewPage(page)) return;
55
-
56
+ const newQuery = { ...route.query };
57
+ newQuery.page = page.toString();
56
58
  history.push({
57
59
  path: history.currentRoute.path,
58
- query: { page: page.toString() },
59
- hash: props.hash != "" ? props.hash : undefined,
60
- });
61
- };
62
- const page = (page: number) => {
63
- if (!isNewPage(page)) return;
64
-
65
- history.push({
66
- path: history.currentRoute.path,
67
- query: { page: page.toString() },
60
+ query: newQuery,
68
61
  hash: props.hash != "" ? props.hash : undefined,
69
62
  });
70
63
  };
@@ -129,6 +122,15 @@ useFyHead({
129
122
  rel: "prev",
130
123
  key: "prev",
131
124
  });
125
+ // add canonical
126
+ const url = getURL();
127
+ if (url) {
128
+ result.push({
129
+ href: `${url.Scheme}://${url.Host}${url.Path}`,
130
+ rel: "canonical",
131
+ key: "canonical",
132
+ });
133
+ }
132
134
  return result;
133
135
  }),
134
136
  });
@@ -154,7 +156,9 @@ useFyHead({
154
156
  <li v-if="items.page_no - 2 > 1">
155
157
  <router-link
156
158
  class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
157
- :to="currentUrl + '1'"
159
+ :to="
160
+ currentUrl + '1' + (props.hash != '' ? `#${props.hash}` : '')
161
+ "
158
162
  >
159
163
  1
160
164
  </router-link>
@@ -174,7 +178,11 @@ useFyHead({
174
178
  >
175
179
  <router-link
176
180
  class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
177
- :to="currentUrl + (items.page_no - (3 - i))"
181
+ :to="
182
+ currentUrl +
183
+ (items.page_no - (3 - i)) +
184
+ (props.hash != '' ? `#${props.hash}` : '')
185
+ "
178
186
  >
179
187
  {{ items.page_no - (3 - i) }}
180
188
  </router-link>
@@ -195,7 +203,11 @@ useFyHead({
195
203
  >
196
204
  <router-link
197
205
  class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
198
- :to="currentUrl + (items.page_no + i)"
206
+ :to="
207
+ currentUrl +
208
+ (items.page_no + i) +
209
+ (props.hash != '' ? `#${props.hash}` : '')
210
+ "
199
211
  >
200
212
  {{ items.page_no + i }}
201
213
  </router-link>
@@ -211,7 +223,11 @@ useFyHead({
211
223
  <li v-if="items.page_no + 2 < items.page_max">
212
224
  <router-link
213
225
  class="flex items-center justify-center px-3 h-8 leading-tight text-fv-neutral-500 bg-white border border-fv-neutral-300 hover:bg-fv-neutral-100 hover:text-fv-neutral-700 dark:bg-fv-neutral-800 dark:border-fv-neutral-700 dark:text-fv-neutral-400 dark:hover:bg-fv-neutral-700 dark:hover:text-white"
214
- :to="currentUrl + items.page_max"
226
+ :to="
227
+ currentUrl +
228
+ items.page_max +
229
+ (props.hash != '' ? `#${props.hash}` : '')
230
+ "
215
231
  >
216
232
  {{ items.page_max }}
217
233
  </router-link>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.7.9",
3
+ "version": "0.8.1",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {