Skip to content

Commit 4f3d5e7

Browse files
Alex-Sokolovposva
andauthored
docs: api update example with router.START_LOCATION (#3531)
Co-authored-by: Eduardo San Martin Morote <[email protected]>
1 parent ad41a21 commit 4f3d5e7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,14 @@ Since it's just a component, it works with `<transition>` and `<keep-alive>`. Wh
349349
Initial route location represented as a [Route Object](#the-route-object) where the router starts at. Can be used in navigation guards to differentiate the initial navigation.
350350
351351
```js
352-
import Router from 'vue-router'
352+
import VueRouter from 'vue-router'
353353

354-
const router = new Router({
354+
const router = new VueRouter({
355355
// ...
356356
})
357357

358358
router.beforeEach((to, from) => {
359-
if (from === START_LOCATION) {
359+
if (from === VueRouter.START_LOCATION) {
360360
// initial navigation
361361
}
362362
})

docs/ru/api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,14 @@ sidebar: auto
349349
Первоначальная навигация будет [объектом Route](#объект-route) с которого запускается маршрутизатор. Можно использовать в навигационных хуках для определения стартовой навигации.
350350
351351
```js
352-
import Router from 'vue-router'
352+
import VueRouter from 'vue-router'
353353

354-
const router = new Router({
354+
const router = new VueRouter({
355355
// ...
356356
})
357357

358358
router.beforeEach((to, from) => {
359-
if (from === START_LOCATION) {
359+
if (from === VueRouter.START_LOCATION) {
360360
// первоначальная навигация
361361
}
362362
})

docs/zh/api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,14 @@ sidebar: auto
330330
以[路由对象](#路由对象)的格式展示初始路由地址,即路由开始的地方。可用在导航守卫中以区分初始导航。
331331
332332
```js
333-
import Router from 'vue-router'
333+
import VueRouter from 'vue-router'
334334

335-
const router = new Router({
335+
const router = new VueRouter({
336336
// ...
337337
})
338338

339339
router.beforeEach((to, from) => {
340-
if (from === START_LOCATION) {
340+
if (from === VueRouter.START_LOCATION) {
341341
// 初始导航
342342
}
343343
})

0 commit comments

Comments
 (0)