vue开发踩过的坑

1、npm install 错误gyp ERR! configure error

解决方法:删除项目下的node_modules和package-lock.json,重新安装需要的包(但是还会报错,但是已经装上了)

2、[Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
解决方法:将main.js文件由

// compiler
new Vue({
  el: '#app',
  router: router,
  store: store,
  template: '<App/>',
  components: { App }
})

改为

//runtime

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app")
发布了24 篇原创文章 · 获赞 13 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_39359584/article/details/103868214