vue配置——>vue.config.js


vue-cli3之后都要写在新建的vue.config.js文件夹中,一般配置如下:

devServer: {
    host: '0.0.0.0',
    port: 8002,
    https: false, // https: {type: boolean}
    open: true, //设置true为打开默认浏览器,也可以指定
    proxy: {
      'admin': {
        target: 'http://192.168.1.171:10182',
        ws: true, //设置websocket
        changeOrigin: true, // 设置跨域
  pathRewrite: { //设置更改前缀
     '^/admin': ''
        }
      }
    }
  },
  publicPath: './', // vue-cli3.3+版本使用


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM