关闭vue语法检查
lintOnSave: false, devServer: { overlay: { warnings: true, errors: true } }
配置build防空白
publicPath:process.env.NODE_ENV=="production"?"./":"/", //打包配置,解决页面空白的配置方案。
lintOnSave: true,
//配置跨域
devServer: {
open: true,
host: 'localhost',
port: 3000,
https: false,
//以上的ip和端口是我们本机的;下面为需要跨域的
proxy: {//配置跨域
'/api': {
target: '',//这里后台的地址模拟的;应该填写你们真实的后台接口
ws: true,
changOrigin: true,//允许跨域
pathRewrite: {
'^/api': ''//请求的时候使用这个api就可以
}
}
}
},
去掉浏览器地址#/
在main.js 里的 new router 里面加
mode: 'history',