@explorer-1/vue 0.2.83 → 0.2.84
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.
package/package.json
CHANGED
|
@@ -186,40 +186,42 @@ export default defineComponent({
|
|
|
186
186
|
},
|
|
187
187
|
addTrailingSlash(path: string) {
|
|
188
188
|
let filteredPath = path
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const isQueryPath = path.includes('?')
|
|
197
|
-
const isAnchorPath = path.includes('#')
|
|
198
|
-
if (
|
|
199
|
-
!isQueryPath &&
|
|
200
|
-
!isAnchorPath &&
|
|
201
|
-
!isFilePath() &&
|
|
202
|
-
path !== '/' &&
|
|
203
|
-
!path.endsWith('/') &&
|
|
204
|
-
!path.startsWith('/preview')
|
|
205
|
-
) {
|
|
206
|
-
// add a trailing slash if there isn't one
|
|
207
|
-
filteredPath += '/'
|
|
208
|
-
} else if (isQueryPath) {
|
|
209
|
-
if (!path.includes('/?')) {
|
|
210
|
-
// also add a trailing slash to paths with query params
|
|
211
|
-
const urlParts = filteredPath.split('?')
|
|
212
|
-
const pathWithSlash = `${urlParts[0]}/`
|
|
213
|
-
const queryParams = urlParts[1]
|
|
214
|
-
filteredPath = pathWithSlash + '?' + queryParams
|
|
189
|
+
if (path && typeof path === 'string') {
|
|
190
|
+
const isFilePath = () => {
|
|
191
|
+
const afterLastSlash = path.split('/').pop()
|
|
192
|
+
if (afterLastSlash && afterLastSlash.includes('.')) {
|
|
193
|
+
return true
|
|
194
|
+
}
|
|
195
|
+
return false
|
|
215
196
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
197
|
+
const isQueryPath = path.includes('?')
|
|
198
|
+
const isAnchorPath = path.includes('#')
|
|
199
|
+
if (
|
|
200
|
+
!isQueryPath &&
|
|
201
|
+
!isAnchorPath &&
|
|
202
|
+
!isFilePath() &&
|
|
203
|
+
path !== '/' &&
|
|
204
|
+
!path.endsWith('/') &&
|
|
205
|
+
!path.startsWith('/preview')
|
|
206
|
+
) {
|
|
207
|
+
// add a trailing slash if there isn't one
|
|
208
|
+
filteredPath += '/'
|
|
209
|
+
} else if (isQueryPath) {
|
|
210
|
+
if (!path.includes('/?')) {
|
|
211
|
+
// also add a trailing slash to paths with query params
|
|
212
|
+
const urlParts = filteredPath.split('?')
|
|
213
|
+
const pathWithSlash = `${urlParts[0]}/`
|
|
214
|
+
const queryParams = urlParts[1]
|
|
215
|
+
filteredPath = pathWithSlash + '?' + queryParams
|
|
216
|
+
}
|
|
217
|
+
} else if (isAnchorPath) {
|
|
218
|
+
if (!path.includes('/#')) {
|
|
219
|
+
// also add a trailing slash to paths with anchors
|
|
220
|
+
const urlParts = filteredPath.split('#')
|
|
221
|
+
const pathWithSlash = `${urlParts[0]}/`
|
|
222
|
+
const anchor = urlParts[1]
|
|
223
|
+
filteredPath = pathWithSlash + '#' + anchor
|
|
224
|
+
}
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
return filteredPath
|
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
v-if="hasContent"
|
|
4
4
|
heading="Past Events"
|
|
5
5
|
variant="cards"
|
|
6
|
-
|
|
7
|
-
// path: 'events',
|
|
8
|
-
query: {
|
|
9
|
-
event_status: 'Past events',
|
|
10
|
-
sortBy: 'eventStartDateLatest',
|
|
11
|
-
page: '1'
|
|
12
|
-
}
|
|
13
|
-
}"
|
|
6
|
+
link="/events/?page=1&event_status=Past+events&sortBy=eventStartDateLatest"
|
|
14
7
|
link-title="View all past events"
|
|
15
8
|
indent="col-1"
|
|
16
9
|
v-bind="$attrs"
|