vue-router icon indicating copy to clipboard operation
vue-router copied to clipboard

Allow nested routes without parent component

Open ghost opened this issue 4 years ago • 5 comments

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.

ghost avatar Mar 23 '20 18:03 ghost

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>

zedsinn avatar May 08 '20 01:05 zedsinn

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

oles avatar Nov 21 '20 20:11 oles

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

xiayulu avatar Dec 22 '20 14:12 xiayulu

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

volarname avatar May 12 '23 19:05 volarname

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.

aryankarim avatar Apr 05 '24 13:04 aryankarim