-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for multiple route-views inside a transition/keep-alive #1118
Comments
Do you have a boiled down snippet of what you are trying to achieve? It would help understanding |
Sure! Effectively what's in the first snippet in my original post.
However, since
[0] - MyModal looks something like
|
Ah I see now! Yeah that Components variable might be the easiest way |
After taking a look, this is currently not possible because one RouterView only renders itself and to be able to provide a If your modal looks like <transition>
<div>
<slot />
</div>
<div>
<slot name="footer" />
</div>
</transition> Then it doesn't matter how you pass the views as they aren't wrapped by the transition anyway.
That would break the existing usage of nested named views. Let's give this more thinking. In any case, it definitely requires going through an RFC. |
I'm using fragment pages a lot. Now you can mount Vue on body element. There is no need for containers. |
@baybal - do you have an example of what you're referring to? I'm not sure how any of that relates to this issue. |
It just hit me it is not related |
I believe I'm trying to achieve something similar for layouts. My ideia was to use named views to pass both view and layout in the route and then render it on the same place, like: // routes.js
{
path: 'sign-in',
components: {
default: SignInView,
layout: AuthLayout,
},
} Then, in the root component: <template>
<RouterView v-slot="{ Component }" name="layout">
<component :is="Component">
<RouterView />
</component>
</RouterView>
</template> But unfortunately the inner |
I have the same issue here as @brendomaciel mentioned As @posva mentioned here in this comment #431 (comment) that nested named views using a slot is not supported yet and must be at the same level, Update |
What problem does this feature solve?
The following is not possible if the
my-modal
component has transitions.If there's no
footer
slot, we can of course use the pattern suggested in the Vue Router docs and userouter-view
's slot props:But then there's no (apparent) way to solve this usecase for the
footer
slot.What does the proposed API look like?
Whatever is most practical.
Provide all named views on the main router-view:
Or enable nested
router-views
to work with named routes? (This is the solution the Vue Discord chat thought was working today for this problem)The text was updated successfully, but these errors were encountered: