道阻且长,行则将至,走慢一点没关系,不停下就好了.|

Ac_c0mpany丶

园龄:3年7个月粉丝:6关注:3

2022-11-14 16:37阅读: 193评论: 0推荐: 0

【Vue-05】修改Vue的默认配置

修改Vue的默认配置

Vue脚手架隐藏了所有webpack相关的配置,若想查看具体的webpack配置,请执行:vue inspect > output.js,若要个性化配置Vue脚手架,就需要创建vue.config.js这一个可选的配置文件

vue.config.js

vue.config.js是一个可选的配置文件,需要放在项目的根目录下(和src同级目录)

  • vue.config.js
module.exports = {
  	// 选项...
  
}

修改Vue项目默认端口

module.exports = {
  	devServer: {
        // 将端口改为8888
        port: 8888
    }
  
}

添加代理

为了避免前后端服务器联调时,产生跨域问题,需要配置代理

module.exports = {
  	devServer: {
        // 以后以/api打头的请求都走代理
        proxy: {
              '/api': {
                target: 'http://localhost:8080',
                changeOrigin: true
     		}
    	}
    }
}

访问后端:localhost:7070/api/students 其中api会走代理

需要配置啥,官方文档现学现查

https://cli.vuejs.org/zh/config/#vue-config-js

本文作者:Ac_c0mpany丶

本文链接:https://www.cnblogs.com/keyongkang/p/16889460.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Ac_c0mpany丶  阅读(193)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起
  1. 1 You Are My Sunshine REOL
You Are My Sunshine - REOL
00:00 / 00:00
An audio error has occurred.

作曲 : Traditional

You are my sunshine

My only sunshine.

You make me happy

When skies are gray.

You'll never know, dear,

How much I love you.

Please don't take my sunshine away

The other night, dear,

When I lay sleeping

I dreamed I held you in my arms.

When I awoke, dear,

I was mistaken

So I hung my head and cried.

You are my sunshine,

My only sunshine.

You make me happy

When skies are gray.

You'll never know, dear,

How much I love you.

Please don't take my sunshine away.

You are my sunshine,

My only sunshine

You make me happy

When skies are gray.

You'll never know, dear

How much I love you

Please don't take my sunshine away

Please don't take my sunshine away.

Please don't take my sunshine away.