This repository was archived by the owner on Jun 12, 2024. It is now read-only.
Commit 1f1fff8 1 parent cd61e36 commit 1f1fff8 Copy full SHA for 1f1fff8
File tree 2 files changed +18
-6
lines changed
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,10 @@ export function isRouteIgnored (name) {
65
65
return config . ignoreRoutes . indexOf ( name ) !== - 1
66
66
}
67
67
68
- export function isRoute ( route ) {
69
- // just check some random properties that we know
70
- // are inside the route object
71
- return route . query && route . params
68
+ export function isRoute ( data ) {
69
+ return data . query && data . params
70
+ }
71
+
72
+ export function isRouter ( data ) {
73
+ return data . currentRoute
72
74
}
Original file line number Diff line number Diff line change @@ -6,13 +6,23 @@ import {
6
6
getQueryString ,
7
7
isRouteIgnored ,
8
8
getRouteAnalytics ,
9
- isRoute
9
+ isRoute ,
10
+ isRouter
10
11
} from '../helpers'
11
12
12
13
export default function page ( ...args ) {
14
+ let route
15
+
16
+ if ( isRouter ( args [ 0 ] ) ) {
17
+ route = args [ 0 ] . currentRoute
18
+ }
19
+
13
20
if ( isRoute ( args [ 0 ] ) ) {
21
+ route = args [ 0 ]
22
+ }
23
+
24
+ if ( route ) {
14
25
const { transformQueryString } = config . autoTracking
15
- const route = args [ 0 ]
16
26
const queryString = getQueryString ( route . query )
17
27
const path = route . path + ( transformQueryString ? queryString : '' )
18
28
You can’t perform that action at this time.
0 commit comments