-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple portals with the same target-el
don't work properly
#61
Comments
Hi @stephan-v Thansk for your request. If you mean that you want to have mutliple components in one target at the same time, that's actually a duplicate of #26 and will be possible eventually - when if find the time to code it ;) But to me it sounds like you want to show different sources in the same target, but only one at a time (as it doesn't make sense to have more than one component in fullscreen at the same time). That's already achievable- you just have to make sure that you only send one source to the portal target at a time, which should be achievable with something similar to this: <portal target="#outside-dom" to="some-name" :disabled="!fullscreen"> you can re-use that anywhere as much as you like and re-use the same target. |
I can't really seem to get it to work properly: https://codepen.io/stephan-v/pen/XaNzpP It simply toggles the components instead of inserting the data in my If this were to work, it would be perfect for my fullscreen scenario. |
Hm, that should work, I even have an example in the repo here that does the same, basically: https://github.com/LinusBorg/portal-vue/tree/develop/example/components/source-switch Will have to investigate, sorry |
Ok so I found two things:
But once I worked around those two things, I got it working: https://codepen.io/LinusBorg/pen/eEByOX I will keep this open as a bug report that |
target-el
don't work properly
So I tried to fix this, but I really can't figure out why it won't work in the Fiddle. It works well in my local test project (but that uses weback/vue-loader). I'm thinking about ditching |
Will be solved with #139 |
Done in Won't be fixed in 1.* |
I am looking for a similar method that you have used here to take elements out of their parent context and move them up in the dom so I can use fullscreen
position: absolute
elements without having to worry about my element hitting a relative container somewhere.What I am missing though is having multiple elements point to the same target. I have a couple of components that I might want to display fullscreen. Their display is toggled through a
view
property in Vuex which decides which particular fullscreen component to display.With your solution I would have to specify a
to
andtarget
for everyone of my components though. I do not care about creating a specific placeholder for each components. I simply want to shove them all up in the dom.Is this still possible with this component somehow or is this is a totally different approach?
The text was updated successfully, but these errors were encountered: