Skip to content

portal-vue #270

@joaopedrodcf

Description

@joaopedrodcf

portal-vue

Portal-vue is a package that was created to add portals to vue ( useful for dialogs,modals etc ) this package was created when vue 2 didn't support portals (which in vue are called teleport)

The last update was 3 years ago and even if they also support vue 3 the best option is to just migrate to the native implementation which is teleport.

https://www.npmjs.com/package/portal-vue


description: vue 3 already supports teleport natively (portal-vue) making the extra dependency unnecessary

App.vue

<template>
  <div>
    <h1>Nuxt App</h1>

    <portal to="teleport-target">
      <p>This is portal</p>
    </portal>
  </div>
</template>
<div id="portal-target">
  <!-- Portal content will render here -->
</div>

Replacements for portal-vue

vue native teleport API

Example:

App.vue

<template>
  <div>
    <h1>Nuxt App</h1>

    <teleport to="#teleport-target">
      <p>This is teleported</p>
    </teleport>
  </div>
</template>

Somewhere in the app

    <div id="teleport-target">
      <!-- Teleported content goes here -->
    </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions