ShanYanWT
Results
comments of
ShanYanWT
感谢提出问题 路由遇到Error: Avoided redundant navigation to current location:报错显示是路由重复,这是多次访问路由形成,不影响使用但是看着不舒服 修复方法 1. 捕获路由跳转异常 this.$router.push({}).catch(e => {}) 或者router文件夹下面的index.js中加 const originalPush = Router.prototype.push Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) }
因为箭头函数默绑定父级作用域的上下文,所以不会绑定vue实例,所以 this 是undefind
因为箭头函数默绑定父级作用域的上下文,所以不会绑定vue实例,所以 this 是undefind