in navbar
<b-dropdown-item href="#" @click="$router.push({ path: '/person' })">Profile</b-dropdown-item>
when click twice, console will warning as following:
NavigationDuplicated Navigating to current location (“/profile”) is not allowed
on the router, you can add .catch(err => {})to avoid warning:
<b-dropdown-item href="#" @click="$router.push({ path: '/person' }).catch(err => {})">Profile</b-dropdown-item>
the issue is on github/issues/2872
解决Vue Router重复导航警告
本文探讨了在使用Vue.js的b-dropdown-item组件时,点击两次导致的重复导航至当前页面('/profile')的问题。文章详细介绍了如何通过在@click事件中添加.catch(err=>{}
1708

被折叠的 条评论
为什么被折叠?



