当前位置:网站首页>基地址:环境变量
基地址:环境变量
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
五.实际应用


开发环境下:

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

可以识别到。
这样我们就可以在生产和开发环境中确定下来一个基地址了。
边栏推荐
- flinkcdc 消费 mysql binlog 没有 sqltype=delete 的数据是什么原
- [Study Notes Dish Dog Learning C] Dynamic Memory Management
- mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf
- Qt中对象树的机制介绍以及底层实现,各种结果分析:(以及自己写容易犯错的点)
- 融云「音视频架构实践」技术专场【内含完整PPT】
- Sfdp 超级表单开发平台 V6.0.5 正式发布
- unsafe.Pointer, pointer, reference in golang
- 小程序+新零售,玩转行业新玩法!
- 2022广东省安全员A证第三批(主要负责人)考试题库及模拟考试
- 脚手架内容详解分析
猜你喜欢

一文看懂推荐系统:召回05:矩阵补充、最近邻查找,工业界基本不用了,但是有助于理解双塔模型

Engineering drawing review questions (with answers)

Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).

怎样提高网络数据安全性

sqoop ETL工具

In the season of going overseas, the localization of Internet tips for going overseas

Small Turtle Compilation Notes

如果禁用了安全启动,GNOME 就会发出警告

There are too many systems, how to realize multi-account interworking?

pytorch applied to MNIST handwritten font recognition
随机推荐
Presto中broadcast join和partition join执行计划的处理过程
【翻译】Terraform和Kubernetes的交集
Polygon zkEVM网络节点
unsafe.Pointer, pointer, reference in golang
2022.8.3-----leetcode.899
There are too many systems, how to realize multi-account interworking?
What is the source of flinkcdc consuming mysql binlog data without sqltype=delete
There are n steps in total, and you can go up to 1 or 2 steps each time. How many ways are there?
LeetCode:899. 有序队列【思维题】
瑞能微计量芯片RN2026的实用程序
Rongyun "Audio and Video Architecture Practice" technical session [complete PPT included]
QNX Hypervisor] 10.2 vdev 8259 2.2 user manual
第08章 索引的创建与设计原则【2.索引及调优篇】【MySQL高级】
MCU C language -> usage, and meaning
(cf)Codeforces Round #811 (Div. 3)A--E详细题解
出海季,互联网出海锦囊之本地化
脚手架内容详解分析
Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。
DIY电工维修如何拆卸和安装开关面板插座
TOML配置文件格式,YAML最有力的竞争者