Click in order · Vue.js course · Module 8: Slots & Dynamic Components

Steps for creating a modal with Teleport

Arrange the steps for implementing a modal with Teleport:

Items to click

  • </Teleport>
  • const isOpen = ref(false)
  • <button @click="isOpen = true">Open</button>
  • <div v-if="isOpen" class="modal">...</div>
  • <Teleport to="body">

You can check the correct answer by solving this task in the CodeWorlds game.