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
routes don't support "children"? #20
Comments
It is 100% correct. Actually you can implement your own child views easily by watching on $route in the page component and using with the I can create and example if you want to see how to implement it? |
sure, looking forward to the example. Many thanks! |
looks like currently nuxt is mainly for building multiple-page apps? If we are building a single-page app but still want server rendered components according to the router url, I guess the most natual way is to support nested components (children and ) |
@beeplin please take a look at this demo: https://hyperdev.com/#!/project/nuxt-children-routes Live demo: https://nuxt-children-routes.hyperdev.space/parent I use |
I am not sure to understand when you are talking about a single-page app, could you describe me what you mean by single-page app? |
Sorry for the vagueness of the term 'single-page app'. Let me take your recent When we are at But in a so-called Which is the case in the actual |
It is indeed the case with |
You mean it's like 'single-page app'? That's wonderful~ If so, is it possible to support |
I'm re-opening this issue to know what think the community about it. We will need to find a way to create child route with the pages folder as well and not only in the For example: -| pages/
----| user/
-------| index.vue
-------| profile.vue
-------| settings.vue
----| user.vue The rule will be:
This would generate: [
{
path: '/user',
component: 'pages/user.vue',
children: [
{ path: '', component: 'pages/user/index.vue' },
{ path: 'profile', component: 'pages/user/profile.vue' },
{ path: 'settings', component: 'pages/user/settings.vue' }
]
}
] And |
cool! |
@Atinux I still don't see how the My use-case is that I have a Am I missing something from your example? |
Ahh.. I should use |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am not sure if I understand it right:
not supporting "children" in routes means we cannot user
<router-view>
in vue components, and therefore means all vue files in/pages
are parallel stand-alone pages and cannot be nested. Since theres is actually no "parent component" and "child component", we have no way to passprops
andslots
into a component in/pages
. The only way to pass something in a component is via router params.Is that correct?
The text was updated successfully, but these errors were encountered: