Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 12, 2022
1 parent 3682871 commit 48c84ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/guide/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ Here comes a problem, though: Since our app is a single page client side app, wi

Not to worry: To fix the issue, all you need to do is add a simple catch-all fallback route to your server. If the URL doesn't match any static assets, it should serve the same `index.html` page that your app lives in. Beautiful, again!

## Abstract mode
## Memory mode

The abstract history mode is created with `createMemoryHistory()`:
The memory history mode doesn't assume a browser environment and therefore doesn't interact with the URL **nor automatically triggers the initial navigation**. This makes it perfect for Node environment and SSR. It is created with `createMemoryHistory()` and **requires you to push the initial navigation** after calling `app.use(router)`.

```js
import { createRouter, createMemoryHistory } from 'vue-router'

const router = createRouter({
history: createMemoryHistory(),
routes: [
Expand All @@ -59,7 +60,7 @@ const router = createRouter({
})
```

When using `createMemoryHistory()` the URL will not change when navigating between routes and no entries will be created in the browser history. The history is kept "hidden" within the javascript. The history will not persist when leaving or reloading the app, you get a fresh start every time your app is reloaded. Vue Router will always try to resolve the root `'/'` path when the app is loaded.
While it's not recommended, you can use this mode inside Browser applications but note **there will be no history**, meaning you won't be able to go _back_ or _forward_.

## Example Server Configurations

Expand Down

0 comments on commit 48c84ab

Please sign in to comment.