Skip to content

NavigationDuplicated error #3160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
951759534 opened this issue Mar 30, 2020 · 1 comment
Closed

NavigationDuplicated error #3160

951759534 opened this issue Mar 30, 2020 · 1 comment

Comments

@951759534
Copy link

951759534 commented Mar 30, 2020

Version

3.1.3

Steps to reproduce

export const dataRouter= [
  {
    path: 'contractWrites',
    name: 'NormalWrites',
    meta: {
      requiresAuth: true
    },
    component: CommonList
  }
  {
    path: 'contractWrites',
    name: 'ContractWrites',
    meta: {
      requiresAuth: true
    },
    component: CommonList
  },
  {
    path: '',
    redirect: {
      path: 'normalWrites'
    }
  }
];

router.js
const routes = [
 {
        path: '/secondReviewList',
        name: 'SecondReviewList',
        component: SecondReviewList,
        meta: {
          requiresAuth: true
        },
        children: dataRouter
      }
]
new Router({
routes,
mode: 'history',
})

view

<button @click="changurl">
   change url
<button>
<router-view></router-view>


js

changeUrl() {
  this.$router.push({
   url: '/secondReviewList/contractWrites'
})
}

What is expected?

no error

What is actually happening?

trigger this onClick event throw NavigationDuplicated error and this url isn't changed

@posva
Copy link
Member

posva commented Mar 30, 2020

Duplicate of #2963

@posva posva marked this as a duplicate of #2963 Mar 30, 2020
@posva posva closed this as completed Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants