0
点赞
收藏
分享

微信扫一扫

vue cli 3.0 proxy vue.config.js cs


vue 2.0版本:在项目的一级目录中有config文件夹,里面有index.js 用来配置路径等等。

 

自定义配置(不同于2.X版本) 

module.exports = {
  devServer: {
    port: 8085, // 端口号
    host: "localhost",
    https: false, // https:{type:Boolean}
    open: true, //配置自动启动浏览器
    // proxy: 'http://localhost:4000' // 配置跨域处理,只有一个代理
    proxy: {
      "/api": {
        target: "<url>",
        ws: true,
        changeOrigin: true
      },
      "/foo": {
        target: "<other_url>"
      }
    } // 配置多个代理
  }
};

 

isCollapse: true,

将默认为折叠

avue-sidebar 菜单

 

举报

相关推荐

0 条评论