]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add note about routes being required
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 21 Sep 2020 07:29:52 +0000 (09:29 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 21 Sep 2020 07:29:52 +0000 (09:29 +0200)
docs/guide/migration/index.md

index 393ffd24ed0a3be8ab288a88fe24a5a6e930d669..ed315724e7a7e262ad82a680505d5a6791e5e471 100644 (file)
@@ -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).