当前位置:网站首页>Uni app advanced style framework / production environment
Uni app advanced style framework / production environment
2022-07-28 01:08:00 【Hua Weiyun】
Style framework

uni-UI The extension component complies with easycom Component specifications , It can be applied directly .
If the component does not conform to easycom standard , You need to manually import and register components in your code before using them .
uni app Of JS
uni app Of JS Code in H5 Run in the browser of the client . Not H5 End ( Including applets and Applications ),Android The platform runs on V8 In the engine ,IOS The platform runs on IOS Of jscore In the engine , No one runs in the browser or WebView in .
Not h5 End does not support windows、documents、navigator And so on JS API, But it also supports standards ECMAScript.
Do not put the browser's JS Extension objects are equivalent to standard JS.
uni app Non - h5 The end also supports standards JS、if、for Equal grammar 、 character string 、 Numbers 、 Time 、 Boolean value 、 Array 、 Custom object and other variable types and various processing methods . Only browser specific objects are supported , Such as window 、 Documents and navigator .
Promise
For asynchronous methods , If no callback parameter is passed in , Such as success、fail and complete, Then the data will be used as promise return . for example :uni getImageInfo()
The method is asynchronous , And there is a return object . If you want to get the return object , At least one callback parameter must be passed in , Such as success、fail、complete etc. .
// Normal use const task = uni.connectSocket( success(res){ console.log(res) } ) // Promise turn uni.connectSocket().then(res => { // Here is success Callback res // If you want to get task , Do not use Promise turn console.log(res) })Uni app Page routing is managed by the framework . Developers need to use JSON To configure the path and page style of each routing page ( Be similar to app.JSON Configure page routing applet in ).
"pages": [ { "path": "pages/index", "style": { "navigationBarTitleText": " Jinxun Education · Routing configuration ", "navigationBarBackgroundColor": "#FFFFFF", "navigationBarTextStyle": "black", "backgroundColor": "#FFFFFF", "enablePullDownRefresh": true } }, { "path": "pages/user", "style": { "navigationBarTitleText": " Jinxun Education · Routing configuration ", "navigationBarBackgroundColor": "#FFFFFF", "navigationBarTextStyle": "black", "backgroundColor": "#FFFFFF", "enablePullDownRefresh": true } }] Due to the size of the applet and resource loading limitations , Each applet platform provides a subcontracting method to optimize the download and startup speed of the applet .
The so-called main package is to place the default startup page /tabbar page , All subcontracting requires some common resources /js Script ; Subcontracting is based on page JSON To configure .
Production environment
if(process.env.NODE_ENV === 'development'){ console.log(' development environment ')}else{ console.log(' Production environment ')}边栏推荐
- Byte flybook Human Resource Kit three sides
- 估值360亿美元!即将进行首次载人发射的SpaceX筹资3.46亿美元
- Resolved Unicode decodeerror: 'UTF-8' codec can't decode byte 0xa1 in position 0: invalid start byte
- 小波变换学习笔记
- iperf安装与使用
- Network device hard core technology insider firewall and security gateway (10)
- 进程与进程调度
- Rongyun IM & RTC capabilities on new sites
- Recommended system - offline recall: u2tag2i, ICF
- 范德蒙德卷积 学习笔记
猜你喜欢

Ink wheel salon | Li Wenjie, Peking University: a graph database system for knowledge atlas application gstore
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP

KMP review + AC automata Prequel

福特SUV版“野马”正式下线,安全、舒适一个不落

函数相关知识

C language programming | explanation and Simulation of offsetof macro
![[CruiseControl]Build Result JSP](/img/80/11c2b539c217ecd6ba55668d3e71e9.png)
[CruiseControl]Build Result JSP

Iperf installation and use

共创文旅新篇章|新起典与国华文旅签订战略合作协议

Resolved Unicode decodeerror: 'UTF-8' codec can't decode byte 0xa1 in position 0: invalid start byte
随机推荐
数据库故障容错之系统时钟故障
【STM32】看门狗模块
Recommendation system model: wide & deep model
代码随想录笔记_哈希_1002查找共用字符
Jerry's prompt sound processing when switching devices [chapter]
How to clearly understand and express IAAs, PAAS and SaaS?
Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!
LeetCode - 寻找两个正序数组的中位数
[CruiseControl]Build Result JSP
接口测试实战项目02:读懂接口测试文档,上手操练
Valued at $36billion! SpaceX, which is about to launch its first manned launch, raised $346million
Storage of deep planing data in memory
Srv6 debut
IP address & subnet mask
Red team killer behinder_ V4.0 (ice scorpion 4.0)
C语言程序设计 | 单身狗题目讲解
福特SUV版“野马”正式下线,安全、舒适一个不落
Multithreading and multithreaded programming
Postman download and use tutorial
[BuildRelease Management]Parabuild