vue router Uncaught (in promise)
2020-03-27 03:51
656 查看
原因: 没有使用catch捕获方法
解决方法: 重写 Router 原型链上的 push、replace 方法
import Router from 'vue-router' const originalPush = Router.prototype.push Router.prototype.push = function push(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) return originalPush.call(this, location).catch(err => err) }
相关文章推荐
- Uncaught (in promise) TypeError: Cannot read property '$router' of undefined
- VUE 报这个错,在浏览器的 console 中报 uncaught (in promise)
- Vue. 之 报错 Uncaught (in promise)
- vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法
- Vuex requires a Promise polyfill in this browser
- vuex requires a Promise polyfill in this browser
- vue-router 报错"Uncaught SyntaxError: Unexpected token }"
- 解决Chrome浏览器无法自动播放音频视频的问题,Uncaught (in promise) DOMException
- Uncaught (in promise) TypeError: __webpack_require__.i(...) is not a function
- vue.js之路(5)——解决vuex requires a Promise polyfill in this browser问题
- 【vuex】【vue】【兼容】IE报vuex requires a Promise polyfill in this browser问题解决
- Vue-cli 在IE下[vuex] vuex requires a Promise polyfill in this browser.问题
- 前端请求外域接口的时候遇到的问题Uncaught SyntaxError: Unexpected token : / Uncaught (in promise)
- VUE 报 Error: [vuex] vuex requires a Promise polyfill in this browser.
- Uncaught (in promise) NotSupportedError: The element has no supported sources.微信小程序音频报错
- 【Angular2】Uncaught (in promise): TypeError: Cannot read property 'id'
- goodslist.js:10 Uncaught (in promise) ReferenceError: Page is not defined
- vue项目不支持IE11浏览器解决方法 vuex requires a Promise polyfill in this browser
- vue在npm run dev时报错Module not found: Error: Can't resolve 'vue-router' in ' …… '
- Uncaught (in promise) TypeError: Super expression must either be null or a function