使用axios引发的惨祸
问题描述:
通过vue add axios,下载axios后
在文件中使用
created(){
//alert("页面加载就运行这里");
axios.get("http://localhost:8181/findAll")
.then(function(response){
console.log(response);
},function(err){
})
}
}
终端报错:
ERROR Failed to compile with 1 error 下午4:14:13
This dependency was not found:vue-editor-bridge in ./node_modules/cache-loader/dist/cjs.js??ref–12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref–0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/Book.vue?vue&type=script&lang=js&
To install it, you can run: npm install --save vue-editor-bridge
然后按照提示运行: npm install --save vue-editor-bridge 会出现not found错误。无法解决。
解决:
当使用axios时会默认在当前文件导入一行代码
import func from 'vue-editor-bridge'
给它删除即可!