Skip to content

Current route's query unaccessible on the App's created hook when using lazy loaded routes #2495

@ThomasFerro

Description

@ThomasFerro

Version

3.0.2

Reproduction link

https://codesandbox.io/s/7mmqoqz18j

Steps to reproduce

  • Start a new vue-cli 3 project with vue-router
  • In the App.vue component, add this created hook :
created() {
  console.log('created', this.$route.query, this.$route.query && this.$route.query.test);
},
  • Run the application using the url http://localhost:8080/#/about?tiers=tezst

What is expected?

The query should be present in the this.$route object.

What is actually happening?

It is not.


Sorry but I cannot get vue-router working on the online IDEs.

I think this is due to the lazy loading because it does works however when calling the home page http://localhost:8080/#/?tiers=tezst.

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