From: Eduardo San Martin Morote Date: Mon, 21 Sep 2020 07:29:52 +0000 (+0200) Subject: docs: add note about routes being required X-Git-Tag: v4.0.0-beta.12~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe9111e2acebcb06f057c08588c5ca7d9ff6fb90;p=thirdparty%2Fvuejs%2Frouter.git docs: add note about routes being required --- diff --git a/docs/guide/migration/index.md b/docs/guide/migration/index.md index 393ffd24..ed315724 100644 --- a/docs/guide/migration/index.md +++ b/docs/guide/migration/index.md @@ -342,6 +342,16 @@ history.replaceState(history.state, '', url) **Reason**: We use the history state to save information about the navigation like the scroll position, previous location, etc. +### `routes` option is required in `options` + +The property `routes` is now required in `options`. + +```js +createRouter({ routes: [] }) +``` + +**Reason**: The router is designed to be created with routes even though you can add them later on. You need at least one route in most scenarios and this is written once per app in general. + ### Navigation guards in mixins are ignored At the moment navigation guards in mixins are not supported. You can track its support at [vue-router#454](https://github.com/vuejs/vue-router-next/issues/454).