系列文章目录
目录
前言
解决axios请求错误报错Uncaught runtime errors:
注:该问题只是出现在开发环境,打包后是不会出现的。
操作方法
这里不详细阐述原理及整个探索过程了,直接给出解决方案。
在vue.config.js中的devServer增加参数 client
devServer: {
https: false,
// hotOnly: false,
client: { overlay: false },
hot: 'only',
proxy: {
'/api': {
target: 'http://localhost:8080/#/',
changeOrigin: true,
pathRewrite: {
'^/api': ''