You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/en/api/api.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,27 @@ const router = getRouter();
127
127
router.push('/hello');
128
128
```
129
129
130
+
### getRoute
131
+
132
+
- **Version**:<VersionTag version="0.17.4" />
133
+
134
+
Return the current routing object information of the router. It is equivalent to using $route in the template syntax and is only applicable to vue-router 3.x.
135
+
136
+
Type definition:
137
+
```ts
138
+
getRoute(): Route
139
+
```
140
+
141
+
```ts
142
+
import { getRoute } from'winjs';
143
+
144
+
exportconstgetCurrentRoute= () => {
145
+
const route =getRoute();
146
+
console.log('current route:', route?.path);
147
+
returnroute;
148
+
};
149
+
```
150
+
130
151
### onBeforeRouteUpdate
131
152
132
153
Adds a navigation guard that is triggered whenever the current location is updated. Similar to `beforeRouteUpdate`, but can be used in any component. The guard is removed when the component is unmounted.
0 commit comments