DEV Community

Discussion on: Promise based Dialog in Vue 2

Collapse
 
daxtersky profile image
Miko

Thanks for the article, got one question though: why not using teleport feature? v3.vuejs.org/guide/teleport.html

Collapse
 
hardyng profile image
Adam Kalinowski

I guess it comes down to preference, but with teleport you still have to maintain state regarding visibility of modals. Additionally, in Vue 2 you also don't have built-in teleport feature, so you will have to install additional dependency. But the main reason for me - it just feels easier to open dialogs through special function, than to work with teleports. The code feels cleaner too, as I really hate seeing HTML for dialogs in some random places.

Collapse
 
mikehtmlallthethings profile image
Mikhail Karan

I just recently used the teleport feature for the first time and yah it solves all these issues. The only issue I had was the veuter plugin didn't have support for vue3 yet and eslint made a red wall of my code. Easily fixed with this though: dev.to/mikhailkaran/setting-up-esl...