报错信息:
Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/search?keywords=%E8%AE%B8%E5%B5%A9”.
解决:
在main.js中添加这段代码:
import Router from 'vue-router'
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}
结束!!
写字难看的原因之一就是笔顺错了