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
createWebHashHistory() // gives a url of `https://example.com/folder#`
206
+
createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
207
+
// if the `#` is provided in the base, it won't be added by `createWebHashHistory`
208
+
createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
209
+
// you should avoid doing this because it changes the original url and breaks copying urls
210
+
createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
211
+
212
+
// at file:///usr/etc/folder/index.html
213
+
// for locations with no `host`, the base is ignored
214
+
createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
215
+
```
216
+
217
+
## createMemoryHistory
218
+
219
+
Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special ___location that is nowhere. It's up to the user to replace that ___location with the starter ___location.
Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special ___location that is nowhere. It's up to the user to replace that ___location with the starter ___location.
| base | string | optional base to provide. Defaults to `___location.pathname` or `/` if at root. If there is a `base` tag in the `head`, its value will be **ignored**. |
51
-
52
-
### Examples
53
-
54
-
55
-
```js
56
-
// at https://example.com/folder
57
-
createWebHashHistory() // gives a url of `https://example.com/folder#`
58
-
createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
59
-
// if the `#` is provided in the base, it won't be added by `createWebHashHistory`
60
-
createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
61
-
// you should avoid doing this because it changes the original url and breaks copying urls
62
-
createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
63
-
64
-
// at file:///usr/etc/folder/index.html
65
-
// for locations with no `host`, the base is ignored
66
-
createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
67
-
```
68
-
69
-
70
3
## createWebHistory
71
4
72
5
## isNavigationFailure
@@ -75,75 +8,78 @@ createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/in
75
8
76
9
## onBeforeRouteLeave
77
10
78
-
Add a navigation guard that triggers whenever the component for the current ___location is about to be left. Similar to but can be used in any component. The guard is removed when the component is unmounted.
11
+
Add a navigation guard that triggers whenever the component for the current ___location is about to be left. Similar to but can be used in any component. The guard is removed when the component is unmounted.
Add a navigation guard that triggers whenever the current ___location is about to be updated. Similar to but can be used in any component. The guard is removed when the component is unmounted.
0 commit comments