<Teleport>

<Teleport> 컴포넌트는 컴포넌트를 DOM의 다른 위치로 텔레포트합니다.
<Teleport>to 대상은 CSS 선택자 문자열 또는 실제 DOM 노드를 기대합니다. Nuxt는 현재 #teleports로의 텔레포트에 대해서만 SSR을 지원하며, 다른 대상에 대해서는 <ClientOnly> 래퍼를 사용한 클라이언트 측 지원만 제공합니다.

Body Teleport

<template>
  <button @click="open = true">
    Open Modal
  </button>
  <Teleport to="#teleports">
    <div
      v-if="open"
      class="modal"
    >
      <p>Hello from the modal!</p>
      <button @click="open = false">
        Close
      </button>
    </div>
  </Teleport>
</template>

Client-side Teleport

<template>
  <ClientOnly>
    <Teleport to="#some-selector">
      <!-- content -->
    </Teleport>
  </ClientOnly>
</template>
Read and edit a live example in Docs > 4 X > Examples > Advanced > Teleport.