- 解決 Vue 路由傳遞參數(shù)時(shí),出現(xiàn) Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation 問(wèn)題?.
- 報(bào)錯(cuò)內(nèi)容:Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/search/111".
- 問(wèn)題描述:重復(fù)點(diǎn)擊導(dǎo)航時(shí),控制臺(tái)報(bào)錯(cuò)
瀏覽器報(bào)錯(cuò)截圖:
?解決方法:src/router/index.js 配置文件中添加以下代碼
// src/router/index.js
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
//添加以下代碼
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-519477.html
?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-519477.html
到了這里,關(guān)于Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location報(bào)錯(cuò)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!