-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Description
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>
43081j
Metadata
Metadata
Assignees
Labels
No labels