vue采坑日记

常见报错

1. Property or method “user” is not defined on the instance but referenced …

解决方法:在data中定义一个user : '',

2.vue报错vue-router.esm.js?8c4f:2007 Uncaught (in promise) NavigationDuplicated

处理方法:

const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
    
    
  return routerPush.call(this, location).catch(error=> error)
}   

3.$ vue-cli-service serve ‘vue-cli-service‘ 不是内部或外部命令,也不是可运行的程序 error Command failed with exit code 1

没有node_modules模块,所以yarn install或者npm install一下就好了

持续更新中…

猜你喜欢

转载自blog.csdn.net/pz1021/article/details/107576652