vue-router
vue-router copied to clipboard
Allow nested routes without parent component
What problem does this feature solve?
This issue already exist, but was closed: https://github.com/vuejs/vue-router/issues/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.
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>
You sure this one needs an RFC, @posva ?
It seems many people are hitting this issue, considering https://github.com/vuejs/vue-router/issues/2105 is the top result when searching for "vue nested routes without main component".
Linking my comment from the original issue: https://github.com/vuejs/vue-router/issues/2105#issuecomment-731629427
Do you mean this: https://reach.tech/router/example/embedded-routers I think this is really an important feature that vue-router should have.
this is really a feature i am missing in vue router, it looks like, any progress on this or place to reopen this?
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.