Skip to content

Prevent parent route data reload when sub router changes #230

@ghost

Description

I have the following route definition:

  '/users': {
    ....
    subRoutes: {
      '/:userId': {
        ....
      }
    }

Parent route and sub route component route object:

route: {
  data () { ... }
}

Every time the sub route changes (e.g /users/1 to /users/2 ) the parent data function is called.
Is there a way to prevent the parent data function from getting called when the sub route changes?

Currently I use activate instead of data in the parent route object. But I think you should use the data function when you want to fetch data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions