0

I am new in vue , Please help me to solve this error:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/User". enter image description here vue code:

vue routes:

import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Main from '../views/Main.vue'
import Mall from '../views/Mall.vue'
import PageOne from '../views/PageOne.vue'
import PageTwo from '../views/PageTwo.vue'

Vue.use(VueRouter)


const routes = [
   
    {
        path: '/',
        component: Main,
        redirect:'/home',
        children: [
       
            { path: 'Home', name:'home', component: Home },
            { path: 'User', name:'user',component: User },
            {path:'Mall', name:'mall',component:Mall },
            {path:'page1',name:'page1',component:PageOne },
            {path:'page2',name:'page2',component:PageTwo },
        ]
    }
]
const router = new VueRouter({
    routes 
})


export default router```


I wish clear that bug..

  • Does this answer your question? [Vue Router push Error: Avoided redundant navigation to current location](https://stackoverflow.com/questions/65878999/vue-router-push-error-avoided-redundant-navigation-to-current-location) – Neha Soni Mar 18 '23 at 08:15
  • the issue is pretty clear in that it's caused by navigating to "/User" while you're already on the "/User" route. The previous comment only addresses how to hide/ignore the error, which may be ok for your use case, but if you want help solving/preventing the issue you'll need to show how you're attempting to navigate. – yoduh Mar 20 '23 at 18:08

0 Answers0