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
Copy file name to clipboardExpand all lines: docs/api/wormhole.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ next: false
8
8
9
9
The Wormhole is not a component, it's an object that connects the `<Portal>`s to their `<PortalTarget>`s.
10
10
11
-
Usually, you will never need to use this object, but you _can_ use this object to programmatically send content to a `<PortalTarget>`, check weither a target exists, and other stuff.
11
+
Usually, you will never need to use this object, but you _can_ use this object to programmatically send content to a `<PortalTarget>`, check whether a target exists, and other stuff.
12
12
13
13
:::warning Public API
14
14
The wormhole object exposes quite a few properties and methods. With regard to semver, only the properties and methods documented below are considered part of the public API.
@@ -125,7 +125,7 @@ Wormhole.hasSource('origin')
125
125
```
126
126
127
127
::: tip Server-Side Rendering
128
-
For the reasons layed out in [the section about SSR](../guide/SSR.md), this method will aleways return `false` during Server-Side Rendering.
128
+
For the reasons layed out in [the section about SSR](../guide/SSR.md), this method will always return `false` during Server-Side Rendering.
129
129
Make sure to Read the linked section for more information.
Copy file name to clipboardExpand all lines: docs/guide/caveats.md
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,25 @@ next: ./migration
6
6
7
7
# Known Caveats
8
8
9
-
Admittedly, portal-vue does a little bit of trickery to do what it does. With this come some caveats, which are documented below.
9
+
Admittedly, portal-vue uses a little bit of trickery to do what it does. With this come some caveats, which are documented below.
10
10
11
11
## Local state lost when toggling `disabled`
12
12
13
-
When togling the `<portal>` component's `disabled` state, components in the portal slot are destroyed and re-created, which means any changes to their local state are lost.
13
+
When toggling the `<portal>` component's `disabled` state, components in the portal slot are destroyed and re-created, which means any changes to their local state are lost.
14
14
15
-
if you need to persist state, use some sort of [state management](https://portal-vue-next-preview.netlify.com/)
15
+
If you need to persist state, use some sort of [state management](https://portal-vue-next-preview.netlify.com/)
16
16
17
17
## provide/inject
18
18
19
-
Due to the way that Vue resolves provides from parent components, it would look for provided objects in the parent of `<portal-target>`, so any `provide`d objects of a parent of `<portal>` will not be available to components within a portal - but it will have access to those provided by parents of the `<portal-target>`.
19
+
Due to the way that Vue resolves provides from parent components, it will look for provided objects in the parent of `<portal-target>`, so any `provide`d objects of a parent of `<portal>` will not be available to components within a portal - but it will have access to those provided by parents of the `<portal-target>`.
20
20
21
21
## `$parent`
22
22
23
-
For the same reason, `this.$parent` will not give your the parent of the `<Portal>`, it will give your the `<PortalTarget>`, so code relying on `$parent` might break
23
+
For the same reason, `this.$parent` will not give you the parent of the `<Portal>`, instead it will give you the `<PortalTarget>`, so code relying on `$parent` might break.
24
+
25
+
### [vue-router](https://router.vuejs.org)
26
+
27
+
`<router-view>` internally walks the $parent chain to find out how many (if any) parent <router-view> components there are. Therefore `<router-view>` inside a `<portal>` will not be able to properly match its nested routes. See [#289](https://github.com/LinusBorg/portal-vue/issues/289) for discussion.
24
28
25
29
## `$refs`
26
30
@@ -34,4 +38,4 @@ this.$nextTick().then(
34
38
)
35
39
```
36
40
37
-
the reason is that depending on the secnario, it _can_ take one tick for the content to be sent to the [Wormhole](../api/wormhole.md) (the middleman between `<Portal>` and `<PortalTarget>`), and another one to be picked up by the `<PortalTarget>`.
41
+
The reason is that depending on the secnario, it _can_ take one tick for the content to be sent to the [Wormhole](../api/wormhole.md) (the middleman between `<Portal>` and `<PortalTarget>`), and another one to be picked up by the `<PortalTarget>`.
Copy file name to clipboardExpand all lines: docs/guide/migration.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ More info:
47
47
48
48
Previously, this event emitted the actual old and new content of the portal, which means: arrays containing vnodes.
49
49
50
-
There never was a real usacase for this, so we now only emit `true` or `false` depending on wether the component has content or not, which allowed us to drop a nice little bit of code.
50
+
There never was a real usacase for this, so we now only emit `true` or `false` depending on whether the component has content or not, which allowed us to drop a nice little bit of code.
0 commit comments