1. Cómo desactivar el juicio de eslint sobre el código
// vue.config.js
module.exports = {
lintOnSave: false
}
2. Cómo hacer un dominio cruzado front-end en vue.config.js
// vue.config.js
module.exports = {
devServer: {
proxy: {
'/api': { // 存在什么的时候进行跨域
target: 'http://xxx:8086', // 目标服务器地址
changeOrigin: true, // 允许改变请求头中的源
pathRewrite: {'^/api': ''} // 重写路径
}
}
}
}