当前位置:网站首页>基地址:环境变量
基地址:环境变量
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
五.实际应用
开发环境下:
我们来看一下是否能够识别到:
可以识别到。
这样我们就可以在生产和开发环境中确定下来一个基地址了。
边栏推荐
- 脚手架内容详解分析
- sqoop ETL tool
- flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
- Good bosses, please ask the flink CDC oracle to Doris, found that the CPU is unusual, a run down
- Sfdp 超级表单开发平台 V6.0.5 正式发布
- Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).
- 数据湖(二十):Flink兼容Iceberg目前不足和Iceberg与Hudi对比
- sqoop ETL工具
- yum 仅下载包
- Utilities of Ruineng Micrometer Chip RN2026
猜你喜欢
【学习笔记之菜Dog学C】动态内存管理
STM8S105k4t6c---------------Light up LED
sqoop ETL tool
ant-design的Select组件采用自定义后缀图标(suffixIcon属性)时,点击该自定义图标没有反应,不会展示下拉菜单的问题
逻辑漏洞----其他类型
STM8S105K4T6------Serial port sending and receiving
STM8S105K4T6------串口发送和接收
Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon
In a more general sense, calculating the displacement distance and assumptions
[Study Notes Dish Dog Learning C] Dynamic Memory Management
随机推荐
织梦响应式酒店民宿住宿类网站织梦模板(自适应手机端)
KingbaseES数据库启动失败,报“内存段超过可用内存”
如何读取 resources 目录下的文件路径?
esp8266-01s刷固件步骤
Engineering drawing review questions (with answers)
Rongyun "Audio and Video Architecture Practice" technical session [complete PPT included]
MCU C language -> usage, and meaning
0.1 前言
[Playwright Test Tutorial] 5 minutes to get started
Day13 Postman的使用
查看mysql死锁语法
kingbaseES V8R2/R3 表在指定表空间,为何显示为默认表空间?
QNX Hypervisor 2.2用户手册]10.1 通用vdev选项
LeetCode每日一题(2285. Maximum Total Importance of Roads)
P3384 【模板】轻重链剖分/树链剖分
FPGA解析B码----连载3
深度学习(三)分类 理论部分
unsafe.Pointer, pointer, reference in golang
STM8S105K4T6------串口发送和接收
How many ways do you know about communication between multiple threads?