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
`@ionic/vue-router` now requires Vue Router v5. Vue Router v4 is no longer supported. Vue Router v5 also raises its peer requirement on Vue itself, so the minimum supported Vue version moves to `3.5.0`.
256
+
257
+
Vue Router v5 is a transition release that ships no runtime breaking changes for Vue Router v4 consumers, so no application code changes are required for routes, navigation guards, or `IonRouterOutlet`. Bump the dep ranges in your app's `package.json`:
258
+
259
+
```diff
260
+
"dependencies": {
261
+
- "vue": "^3.4.0",
262
+
- "vue-router": "^4.0.0"
263
+
+ "vue": "^3.5.0",
264
+
+ "vue-router": "^5.0.0"
265
+
}
266
+
```
267
+
268
+
#### Deprecation Warning for `next()` in Navigation Guards
269
+
270
+
Vue Router v5 prints a deprecation warning when `next()` is called inside `beforeRouteLeave`, `beforeRouteEnter`, `beforeRouteUpdate`, or `router.beforeEach`. The callback form still works, but Vue Router v6 will remove it. Migrate to the return-value pattern:
271
+
272
+
```diff
273
+
// Composition API
274
+
onBeforeRouteLeave((to, from) => {
275
+
- if (!confirm('Leave?')) return next(false);
276
+
- next();
277
+
+ if (!confirm('Leave?')) return false;
278
+
+ return true;
279
+
});
280
+
```
281
+
282
+
```diff
283
+
// Options API
284
+
- beforeRouteLeave(to, from, next) {
285
+
- if (!confirm('Leave?')) return next(false);
286
+
- next();
287
+
+ beforeRouteLeave(to, from) {
288
+
+ if (!confirm('Leave?')) return false;
289
+
+ return true;
290
+
}
291
+
```
292
+
293
+
For more information on migrating from Vue Router v4 to v5, refer to the [Vue Router v4-to-v5 migration guide](https://router.vuejs.org/guide/migration/v4-to-v5.html).
0 commit comments