Skip to content
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

Allow nested routes without parent component #3156

Open
ghost opened this issue Mar 23, 2020 · 5 comments
Open

Allow nested routes without parent component #3156

ghost opened this issue Mar 23, 2020 · 5 comments
Labels
feature request fixed on 4.x This issue has been already fixed on the v4 but exists in v3

Comments

@ghost
Copy link

ghost commented Mar 23, 2020

What problem does this feature solve?

This issue already exist, but was closed: #2105 I do believe it shouldn't have been.

The PassThrough solution will most likely do it, but it is a workaround. I do not want to specify every view as a pass through.

This should imo. be supported by vue-router directly, making it easier to design ones system as small sub components, allowing each component to know it's own navigation and be loosely coupled.

Also, I don't know if it's the same or another issue, but name hierarchies would make this feature quite powerful

What does the proposed API look like?

Interface wise I would say it makes sense to simply default to this behavior if component isn't specified.

@zedsinn
Copy link

zedsinn commented May 8, 2020

Its a bit pointless to have to have this file:

<template>
  <router-view></router-view>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';

@Component
export default class ParentPage extends Vue {}
</script>

<style lang="scss" scoped>
</style>

@posva posva added the needs RFC This feature request needs to go through the RFC process to gather more information label Jun 24, 2020
@oles
Copy link

oles commented Nov 21, 2020

You sure this one needs an RFC, @posva ?

It seems many people are hitting this issue, considering #2105 is the top result when searching for "vue nested routes without main component".

Linking my comment from the original issue: #2105 (comment)

@xiayulu
Copy link

xiayulu commented Dec 22, 2020

Do you mean this: https://reach.tech/router/example/embedded-routers
I think this is really an important feature that vue-router should have.

@posva posva added fixed on 4.x This issue has been already fixed on the v4 but exists in v3 feature request and removed needs RFC This feature request needs to go through the RFC process to gather more information labels May 21, 2022
@volarname
Copy link

this is really a feature i am missing in vue router, it looks like, any progress on this or place to reopen this?

@aryankarim
Copy link

God this feature will my code more readable and maintainable.

I agree with @ghost on the design:

Interface wise I would say it makes sense to simply default to this behavior if component isn't specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request fixed on 4.x This issue has been already fixed on the v4 but exists in v3
Projects
None yet
Development

No branches or pull requests

6 participants