From: Eduardo San Martin Morote Date: Sun, 20 Sep 2020 19:26:43 +0000 (+0200) Subject: docs: note about router-view slot X-Git-Tag: v4.0.0-beta.12~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9d4311d43b3f1b75c04abe7a88ba0b475d7bdb0;p=thirdparty%2Fvuejs%2Frouter.git docs: note about router-view slot From #475 --- diff --git a/docs/api/index.md b/docs/api/index.md index 97571255..0a033520 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -433,6 +433,10 @@ _Parameters_ | --------- | ----------------------------------- | ------------------- | | route | [`RouteRecordRaw`](#routerecordraw) | Route Record to add | +:::tip +Note adding routes does not trigger a new navigation, meaning that the added route will not be displayed unless a new navigation is triggered. +::: + ### afterEach Add a navigation hook that is executed after every navigation. Returns a function that removes the registered hook. diff --git a/docs/guide/migration/index.md b/docs/guide/migration/index.md index c25a8540..393ffd24 100644 --- a/docs/guide/migration/index.md +++ b/docs/guide/migration/index.md @@ -285,6 +285,26 @@ The object returned in `scrollBehavior` is now similar to [`ScrollToOptions`](ht **Reason**: This is was a necessary change. See the [related RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0034-router-view-keep-alive-transitions.md). +### Passing content to route components' `` + +Before you could directly pass a template to be rendered by a route components' `` by nesting it under a `` component: + +```html + +

In Vue Router 3, I render inside the route component

+
+``` + +Because of the introduction of the `v-slot` api for ``, you must pass it to the `` using the `v-slot` API: + +```html + + +

In Vue Router 3, I render inside the route component

+
+
+``` + ### Removal of `parent` from route locations The `parent` property has been removed from normalized route locations (`this.$route` and object returned by `router.resolve`). You can still access it via the `matched` array: