]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: improve mode change
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 22 May 2020 09:29:11 +0000 (11:29 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Fri, 22 May 2020 09:29:11 +0000 (11:29 +0200)
Close #266

README.md

index e6358d8a81f2ddef5f2d9d60b2c34264b6c8a38e..765c25a4b01ba474019552c17fcdf40c7811c29e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -12,7 +12,18 @@ Check the [playground](https://github.com/vuejs/vue-router-next/tree/master/play
 
 ### Breaking changes compared to vue-router@3.x
 
-- `mode: 'history'` -> `history: createWebHistory()`
+- The `mode: 'history'` option has been replaced with a more flexible one named `history`:
+
+  ```js
+  import { createRouter, createWebHistory } from 'vue-router'
+  // there is also createWebHashHistory and createMemoryHistory
+
+  createRouter({
+    history: createWebHistory(),
+    routes: [],
+  })
+  ```
+
 - `base` option is now passed as the first argument to `createWebHistory` (and other histories)
 - Catch all routes (`/*`) must now be defined using a parameter with a custom regex: `/:catchAll(.*)`
 - `router.match` and `router.resolve` are merged together into `router.resolve` with a slightly different signature