当前位置:网站首页>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 ')}边栏推荐
- R language evaluates the relative importance of the predictive factors (variables, characteristics) of the regression model, scales the predictive variables of the regression model, and then construct
- [STM32] watchdog module
- Postman下载、使用教程
- 深度刨析数据在内存中的存储
- 网络设备硬核技术内幕 防火墙与安全网关篇 (七) 虚拟化神器 (上)
- Can TSMC Samsung build a production line without American equipment for Huawei?
- Resolved Unicode decodeerror: 'UTF-8' codec can't decode byte 0xa1 in position 0: invalid start byte
- 【OpenCV 例程 300篇】241. 尺度不变特征变换(SIFT)
- MySQL中的运算符
- 怎么清晰地理解、表达 IaaS 、 PaaS 、 SaaS ?
猜你喜欢

融云 IM & RTC 能力上新盘点

Syntaxerror resolved: positive argument follows keyword argument
![论文赏析[ICLR18]联合句法和词汇学习的神经语言模型](/img/1c/5b9726b16f67dfc2016a0c2035baae.png)
论文赏析[ICLR18]联合句法和词汇学习的神经语言模型

C语言程序设计 | offsetof宏的讲解及其模拟实现

Jointly create a new chapter in cultural tourism | xinqidian signs a strategic cooperation agreement with Guohua cultural tourism

110. SAP UI5 FileUploader 控件深入介绍 - 为什么需要一个隐藏的 iframe

Rongyun IM & RTC capabilities on new sites

C language programming | single dog topic explanation

Recommend a Hongmeng instant messaging software "fruit chat", which is a bit awesome!!

接口测试实战项目02:读懂接口测试文档,上手操练
随机推荐
Wavelet transform learning notes
Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!
7. Typescript part Foundation
Border width border fillet border color
SRv6初登场
Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm
Logic of automatic reasoning 09 - automatic theorem proving
推荐系统-模型:dssm双塔模型做embedding的召回
《KMP复习 + AC自动机》前传
One year anniversary of creation, Chongba young Lang
Understanding of cap
共创文旅新篇章|新起典与国华文旅签订战略合作协议
Swear, swear, swear
Scrollview, tableview nested solutions
[proteus simulation] 51 single chip microcomputer washing machine simulation control program
Count the six weapons of the domestic interface cooperation platform!
Self use drawing bed building tutorial
scrollview、tableView嵌套解决方案
Interface test practical project 02: read interface test documents and practice
uni-app进阶之样式框架/生产环境