Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

435
Views
Refreshing a vue component from a vue-router route

I have a view in my SPA that is loaded via vue router when a user types in a id in my sidebar. The component loads up and the prop is passed correctly through the route but if I type into the sidebar another id to load up I get this in console:

"vue-router.min.js:11 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/mainreview/search?id=1560".

My search functionality is using push() from a axios request to confirm that id exists and returns that as an array then pushes the component:

router.push({ path: '/mainreview/search', query: { mmcid: this.id[0].ID } });

My route is as follows:

 { path: '/mainreview/search', component: mainreview, props: route => ({ id: route.query.id })}

Most posts I have found on here seem to recommend suppressing the error but in my case I want it to reload the component so that the mount function inside the component runs again which is what triggers my an axios call with all my data.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you only need an id and no other query param is needed, why don't just use it as url param?

{ 
    path: '/mainreview/search/:id', 
    component: mainreview, 
    props: true
}

Then you can push

router.push({ path: '/mainreview/search', params: { id: this.id[0].ID } });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!