当前位置:网站首页>基地址:环境变量
基地址:环境变量
2022-08-04 03:01:00 【这次我一定要赢】
一.作用
环境变量:为不同环境设置不同变量
二.开发环境
development
流程:
1.根目录创建一个文件.env.development
2.在文件中设置相应环境的变量
接口基地址;VUE_APP_开头
VUE_APP_URL='开发环境接口基地址'
三.生产环境
production
1.根目录创建一个文件.env.production
2.在文件中设置相应环境的变量
接口基地址;VUE_APP_开头
VUE_APP_URL='生产环境接口基地址'
四.使用
process.env.VUE_APP_URL可以拿到定义的值
npm run server 开发:process.env.VUE_APP_URL===aaa
npm run build 生产:process.env.VUE_APP_URL===bbb
五.实际应用


开发环境下:

我们来看一下是否能够识别到:

可以识别到。
这样我们就可以在生产和开发环境中确定下来一个基地址了。
边栏推荐
- Small Turtle Compilation Notes
- 一文看懂推荐系统:召回05:矩阵补充、最近邻查找,工业界基本不用了,但是有助于理解双塔模型
- 董明珠直播时冷脸离场,员工频犯低级错误,自家产品没人能弄明白
- yum 仅下载包
- 异步编程解决方案 Generator生成器函数、iterator迭代器、async/await、Promise
- 深度学习(三)分类 理论部分
- Big guys, it takes a long time to read mysql3 million single tables, what parameters can be discounted, or is there any way to hurry up
- 2022.8.3-----leetcode.899
- 香港服务器有哪些常用的型号
- [Playwright Test Tutorial] 5 minutes to get started
猜你喜欢

为什么用Selenium做自动化测试

Mini program + new retail, play the new way of playing in the industry!
![[Playwright Test Tutorial] 5 minutes to get started](/img/68/36dd8ef4a4073f03d5e5dad91be20d.png)
[Playwright Test Tutorial] 5 minutes to get started

Example 039: Inserting elements into an ordered list

Sfdp 超级表单开发平台 V6.0.5 正式发布

LeetCode:899. 有序队列【思维题】

pytorch应用于MNIST手写字体识别

Small Turtle Compilation Notes

【学习笔记之菜Dog学C】动态内存管理

逻辑漏洞----其他类型
随机推荐
SQL注入中 #、 --+、 --%20、 %23是什么意思?
Flink原理流程图简单记录
异步编程解决方案 Generator生成器函数、iterator迭代器、async/await、Promise
从图文展示到以云为核,第五代验证码独有的策略情报能力
Polygon zkEVM网络节点
架构实战营模块三作业
ssh服务详解
【Playwright测试教程】5分钟上手
查看mysql死锁语法
MySQL 查询练习(1)
KingbaseES数据库启动失败,报“内存段超过可用内存”
flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
ingress 待完善
脚手架内容详解分析
阿里云国际版基于快照与镜像功能迁移云服务器数据
各位大佬好,麻烦问一下flink cdc oracle写入doris的时候,发现cpu异常,一下下跑
Pine脚本 | 如何显示和排版绘图开关?
In the season of going overseas, the localization of Internet tips for going overseas
董明珠直播时冷脸离场,员工频犯低级错误,自家产品没人能弄明白
QNX Hypervisor 2.2 user manual] 10.1 gm vdev options