当前位置:网站首页>Variables d'environnement personnalisées uniapp
Variables d'environnement personnalisées uniapp
2022-07-04 06:23:00 【Voyageur spatio - temporel】
1、Créer sous le Répertoire racine package.json Documentation,Écrivez ce qui suit,Voir le site Web pour les éléments de configuration spécifiques package.json
{
"uni-app": {
"scripts": {
"dev": {
// Nom de l'élément de configuration
"title":"h5Environnement d'essai", // Nom dans la barre d'outils du menu
"env": {
"UNI_PLATFORM": "h5" // Plate - forme
},
"define": {
"H5-DEV": true // Nom de la variable
}
},
"prod": {
"title":"h5Environnement de production",
"env": {
"UNI_PLATFORM": "h5"
},
"define": {
"H5-PROD": true
}
}
}
}
}
2、Utilisation de variables d'environnement
// #ifdef H5-DEV
console.log('dev')
// #endif
// #ifdef H5-PROD
console.log('prod')
// #endif
3、Compiler l'emballage

边栏推荐
- 如何避免 JVM 内存泄漏?
- Common JS tool Libraries
- SQL join, left join, right join usage
- JSON Web Token----JWT和传统session登录认证对比
- Fast power (template)
- A little understanding of GSLB (global server load balance) technology
- 70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
- Arcpy 利用updatelayer函数改变图层的符号系统
- JSON Web Token----JWT和傳統session登錄認證對比
- How to help others effectively
猜你喜欢

InputStream/OutputStream(文件的输入输出)

ES6 modularization

C实现贪吃蛇小游戏

ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station

How to solve the component conflicts caused by scrollbars in GridView

AWT introduction

测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文

Json Web token - jwt vs. Traditional session login Authentication

Sleep quality today 78 points

buuctf-pwn write-ups (8)
随机推荐
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
JS get the attribute values nested in the object
【无标题】
Distributed cap theory
Sword finger offer II 038 Daily temperature
Appium基础 — APPium安装(二)
我的NVIDIA开发者之旅——优化显卡性能
C语言中的排序,实现从小到大的数字排序法
STM32 单片机ADC 电压计算
【微服务】Nacos集群搭建以及加载文件配置
采用中微BATG135实现IIC数据/指令交互
树形dp
Install pytoch geometric
QT qtablewidget table column top requirements ideas and codes
JS execution mechanism
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
Which water in the environment needs water quality monitoring
配置交叉编译工具链和环境变量
How does apscheduler set tasks not to be concurrent (that is, execute the next task after the first one)?
AWT介绍