当前位置:网站首页>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
边栏推荐
- Appium基础 — APPium安装(二)
- LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
- Invalid revision: 3.18.1-g262b901-dirty
- 24 magicaccessorimpl can access the debugging of all methods
- STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
- Reading notes of Clickhouse principle analysis and Application Practice (4)
- Leetcode question brushing record | 206_ Reverse linked list
- MySQL learning notes 3 - JDBC
- 【无标题】
- Fast power (template)
猜你喜欢
随机推荐
报错cvc-complex-type.2.4.a: 发现了以元素 ‘base-extension‘ 开头的无效内容。应以 ‘{layoutlib}‘ 之一开头。
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
Sword finger offer II 038 Daily temperature
17-18. Dependency scope and life cycle plug-ins
C语言中的排序,实现从小到大的数字排序法
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
2022.7.3-----leetcode. five hundred and fifty-six
Weekly summary (*63): about positive energy
Operator < <> > fool test case
[Chongqing Guangdong education] electronic circuit homework question bank of RTVU secondary school
QT qtablewidget table column top requirements ideas and codes
Lightroom import picture gray / Black rectangular multi display
How to get the parent node of all nodes in El tree
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
The width of the picture in rich text used by wechat applet exceeds the problem
QT get random color value and set label background color code
The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function
JS flattened array of number shape structure
Grounding relay dd-1/60
buuctf-pwn write-ups (8)