Skip to content

Document Named Views and Nested Routes #1921

Closed
@oixan

Description

@oixan

Version

3.0.1

Reproduction link

Full problem Example
https://jsfiddle.net/oaxs8ek8/

Steps to reproduce

I have created a Homepage with 2 Named Views called for example RouteA and RouteB.
Now RouteA and RouteB have 2 other nested routes like so RouteA1 and RouteA2 - RouteB1 and RouteB2.

const router = new VueRouter({
  routes: [
    {
      path: '/',
      components: {
        RouteA : Bar,
        RouteB: Baz
      }
    }
  ]
})

this work very well for the first route but then i cant continue the routing chain for the 2 differente route since i cant only do this:

const router = new VueRouter({
  routes: [
    {
      path: '/',
      components: {
        RouteA : Bar,
        RouteB: Baz
      },
      children: [
        {
          path: '' // Load RouteA1 on RouteA
          component: UserProfile
        },
        {
          path: '', // Load RouteB1 on RouteB
          component: UserPosts
        }
      ]
    }
    }
  ]
})

There is no way to specify the different route.

A solution could be enable this for example:

const router = new VueRouter({
  routes: [
    {
      path: '/',
      components: {
        RouteA : {
                     path: ''
                     component: Bar,
                     children:{
                        ....
                     }
              },
        RouteB:  {
                     path: ''
                     component: Baz,
                     children:{
                        ....
                     }
      }
    }
  ]
})

What is expected?

The router should allow nested route with named view router

What is actually happening?

it's not routeing correctly

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions