Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

vue3 teleport

<button @click="open = true">Open Modal</button>

<Teleport to="body">
  <div v-if="open" class="modal">
    <p>Hello from the modal!</p>
    <button @click="open = false">Close</button>
  </div>
</Teleport>
Source by vuejs.org #
 
PREVIOUS NEXT
Tagged: #teleport
ADD COMMENT
Topic
Name
2+3 =