diff --git a/src/guide/built-ins/teleport.md b/src/guide/built-ins/teleport.md index e63ec654..5cd6a531 100644 --- a/src/guide/built-ins/teleport.md +++ b/src/guide/built-ins/teleport.md @@ -6,9 +6,9 @@ ## Basic Usage {#basic-usage} -Sometimes we may run into the following scenario: a part of a component's template belongs to it logically, but from a visual standpoint, it should be displayed somewhere else in the DOM, outside of the Vue application. +Sometimes a part of a component's template belongs to it logically, but from a visual standpoint, it should be displayed somewhere else in the DOM, perhaps even outside of the Vue application. -The most common example of this is when building a full-screen modal. Ideally, we want the modal's button and the modal itself to live within the same component, since they are both related to the open / close state of the modal. But that means the modal will be rendered alongside the button, deeply nested in the application's DOM hierarchy. This can create some tricky issues when positioning the modal via CSS. +The most common example of this is when building a full-screen modal. Ideally, we want the code for the modal's button and the modal itself to be written within the same single-file component, since they are both related to the open / close state of the modal. But that means the modal will be rendered alongside the button, deeply nested in the application's DOM hierarchy. This can create some tricky issues when positioning the modal via CSS. Consider the following HTML structure. @@ -169,11 +169,11 @@ In some cases, we may want to conditionally disable ``. For example, w ``` -Where the `isMobile` state can be dynamically updated by detecting media query changes. +We could then dynamically update `isMobile`. ## Multiple Teleports on the Same Target {#multiple-teleports-on-the-same-target} -A common use case would be a reusable `` component, with the potential for multiple instances to be active at the same time. For this kind of scenario, multiple `` components can mount their content to the same target element. The order will be a simple append - later mounts will be located after earlier ones within the target element. +A common use case would be a reusable `` component, with the potential for multiple instances to be active at the same time. For this kind of scenario, multiple `` components can mount their content to the same target element. The order will be a simple append, with later mounts located after earlier ones, but all within the target element. Given the following usage: