Skip to content
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

切换tab页时,控制台会出现Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: #1

Open
hys12345 opened this issue May 13, 2021 · 0 comments

Comments

@hys12345
Copy link

当在激活的tab页再次点击时,控制台会报错:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location:

在Tabs.vue中的点击事件方法中,在 进行路由导航时先进行判断,是否是导航到同一个路由。如果不相同在进行导航。

`clickTab(target){
//解决Avoided redundant navigation to current location
if (this.$router.currentRoute.name !== target.name) {
this.$router.push({name:target.name});
this.$store.commit("editableTabsValue",target.name);
}

        }`
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

1 participant