原文:解決"Uncaught (in promise) Error: Navigation cancelled from "/" to "/login" with a new navigation"報錯處理

Uncaught in promise Error: Navigation cancelled from to login with a new navigation. 這個錯誤是vue router內部錯誤,沒有進行catch處理,導致的編程式導航跳轉問題,往同一地址跳轉時會報錯的情況。 push和replace 都會導致這個情況的發生。 解決方法如下: 在路由器中進行配置:router ind ...

2021-01-06 11:47 0 3231 推薦指數:

查看詳情

vue-router 報錯Navigation cancelled from“/...“ to “/...“ with a new navigation.

vue-router@3.0版本及以上回調形式已經改成promise api的形式了,返回的是一個promise,如果路由地址跳轉相同, 且沒有捕獲到錯誤,控制台始終會出現如圖所示的警告 (注:3.0以下版本則不會出現以下警告!!!,因路由回調問題…) * 怎么解決呢? 方案一: 安裝 ...

Wed Dec 09 22:54:00 CST 2020 0 1561
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM