当前位置:网站首页>Mini Program--Independent Subcontracting & Subcontracting Pre-download
Mini Program--Independent Subcontracting & Subcontracting Pre-download
2022-08-01 21:35:00 【like Feynman %】
1. What is independent subcontracting
Independent subcontracting is essentially subcontracting, but it is relatively clear and can be run independently of the main package and other subcontracting
2. The difference between independent subcontracting and ordinary subcontracting
The main difference: whether it depends on the main package to run
- Ordinary subpackage depends on the main package
- Independent subpackage can run independently without downloading the main package
3. Application scenarios of independent subcontracting
Developers can configure certain pages with certain functional independence to independent as neededIn subcontracting.Here's why:
- When the applet restarts from the normal subpackage page, the main package needs to be downloaded first
- The independent subcontracting can run without relying on the main package, which can greatly improve the startup speed of the subcontracting page
4. Configuration method of independent subcontracting ("independent": true)
"subpackages": [{"root": "packageA","name": "p1","pages": ["pages/cat","pages/dog"]},{"root": "packageB","name": "p2","pages": ["pages/apple","pages/banana"],"independent": true}],
5. Citation principles
Independent subcontracting, common subcontracting and main subcontracting are isolated from each other and cannot reference each other's resources, for example:
- Main packageCannot referenceprivate resources of independent subcontracts
- Between independent subcontracts, cannot refer to each otherprivate resources
- Between independent subcontracting and common subcontracting, cannot refer to each otherprivate resources
- Special attention: public resources in the main package cannot be referenced in independent subcontracts
6.1 Subpackage pre-download refers to: when entering a certain page of the applet, The framework automatically pre-downloads the sub-packages that may be required, therebyImprove the startup speed when entering the subsequent subcontracting page
6.2 Configuring subpackage pre-download
The behavior of pre-downloading subpackages, will be triggered when entering the specified page, in app.json, use preloadRule section point to define the pre-download rules for sub-packages, example code:
"preloadRule": {"pages/contact/contact":{"network": "all",//Indicates pre-downloading in the specified network mode, the optional values are all (unlimited network) and WiFi (download only in WiFi mode)"packages": ["packageA"]//packages indicates which subpackages are pre-downloaded after entering the page//You can specify which subpackages are pre-downloaded by root or name}},
6.3 Restrictions on subpackage pre-download
Pages in the same subpackage have a common pre-download size limit of 2M
边栏推荐
猜你喜欢
作业8.1 孤儿进程与僵尸进程
【中文树库标记---CTB】
TP5-NPs负载噻吩类化合物TP5白蛋白纳米粒/阿魏酸钠新糖牛血清蛋白纳米粒
shell规范与变量
FusionGAN:A generative adversarial network for infrared and visible image fusion article study notes
方舟:生存进化PVE模式和PVP模式
包含吲哚菁绿的多聚体白蛋白纳米球/载马钱子碱纳米粒的牛血清白蛋白微球的制备
The difference between groupByKey and reduceBykey
Pagoda application experience
RecycleView的使用
随机推荐
HCIP---企业网的架构
PyQt5 + MySQL5.8 【学生信息管理系统】【增删改查】
groupByKey和reduceBykey的区别
P7215 [JOISC2020] 首都 题解
C Pitfalls and Defects Chapter 7 Portability Defects 7.9 Case Conversion
sizeof的详细解说和与strlen的区别
ImportError: `save_weights` requires h5py.问题解决
JVM内存结构详解
shell规范与变量
微软校园大使喊你来秋招啦!
【接口测试】JMeter调用JS文件实现RSA加密
Spark cluster construction
附录A printf、varargs与stdarg A.3 stdarg.h ANSI版的varargs.h
Appendix A printf, varargs and stdarg a. 2 use varargs. H to realize the variable argument list
包含吲哚菁绿的多聚体白蛋白纳米球/载马钱子碱纳米粒的牛血清白蛋白微球的制备
ORI-GB-NP半乳糖介导冬凌草甲素/姜黄素牛血清白蛋白纳米粒的研究制备方法
关键字搜索:“淘宝商品 API ”
C陷阱与缺陷 第7章 可移植性缺陷 7.7 除法运算时发生的截断
淘宝获取收货地址列表的 API
磷酸化甘露糖苷修饰白蛋白纳米粒/卵白蛋白-葡聚糖纳米凝胶的