vue-simple-portal icon indicating copy to clipboard operation
vue-simple-portal copied to clipboard

Announcment: No Vue 3 support planned, use native <teleport> instead

Open LinusBorg opened this issue 3 years ago • 2 comments

Vue 3 introduced <teleport>, a feature which was very much inspired by the functionality provided by this library.

It does everything this library does, but better and without any caveats or hacks, as the moving of the DOM is implemented directly in Vue 3's renderer.

For that reason, this library will not be ported to Vue 3. The migration path is pretty straightforward:

Vue 2 & vue-simple-portal

<portal selector="#portal-target">
  <p>This will be mounted as a child element
    of <div id="portal-parget"> instead of
    somewhere inside the child tree of <div id="app">
  </p>
</portal>

Vue 3

<teleport to="#portal-target">
  <p>This will be mounted as a child element
    of <div id="portal-parget"> instead of
    somewhere inside the child tree of <div id="app">
  </p>
</teleport>

LinusBorg avatar Dec 22 '20 18:12 LinusBorg

Awesome work on this project, and the original project @LinusBorg! I've been using vue-portal for years! Fantastic to see this in Vue 3 core...no doubt in part thanks to your work. I'm happy to see that you've put together this new simpler/lighter version of vue-portal. I suspect I'll be using Vue 2 for a long time still, so this is great to have! 👍

reinink avatar Apr 02 '21 10:04 reinink

Still useful for projects that support both vue 2 and 3 using vue-demi

wobsoriano avatar Jul 30 '21 05:07 wobsoriano