代理只有在开发环境中才可以使用 (获取 env 文件中的 value 类型都为 string)
一、在 vue.config.js 文件中进行配置
在 devServer 中使用以下代码
当环境配置文件中的代理参数为 true 时启用代理

二、对请求接口的全局变量进行修改

进行了以上配置之后开启代理就ok
代理只有在开发环境中才可以使用 (获取 env 文件中的 value 类型都为 string)
在 devServer 中使用以下代码
当环境配置文件中的代理参数为 true 时启用代理
进行了以上配置之后开启代理就ok
本文标题:9.Vue3.0配置代理
本文链接:https://www.haomeiwen.com/subject/hhjaoqtx.html
网友评论