Skip to content

Commit 60a9015

Browse files
committed
docs: removal of router.app
Close #700
1 parent 6edba5c commit 60a9015

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/guide/migration/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@ Otherwise there will be an initial transition as if you provided the `appear` pr
223223

224224
Note that **if you have navigation guards upon the initial navigation**, you might not want to block the app render until they are resolved unless you are doing Server Side Rendering. In this scenario, not waiting the router to be ready to mount the app would yield the same result as in Vue 2.
225225

226+
### Removal of `router.app`
227+
228+
`router.app` used to represent the last root component (Vue instance) that injected the router. Vue Router can now be safely used by multiple Vue applications at the same time. You can still add it when using the router:
229+
230+
```js
231+
app.use(router)
232+
router.app = app
233+
```
234+
235+
You can also extend the TypeScript definition of the `Router` interface to add the `app` property.
236+
237+
**Reason**: Vue 3 applications do not exist in Vue 2 and now we property support multiple applications using the same Router instance, so having an `app` property would have been misleading because it would have been the application instead of the root instance.
238+
226239
### Passing content to route components' `<slot>`
227240

228241
Before you could directly pass a template to be rendered by a route components' `<slot>` by nesting it under a `<router-view>` component:

0 commit comments

Comments
 (0)