当前位置:网站首页>Uni app subcontracting loading and optimization

Uni app subcontracting loading and optimization

2022-06-13 08:44:00 Dependency_ Lai

Document organization :
 Insert picture description here

pages.json To configure :

{
    
	"pages": [ //pages The first item in the array represents the application startup page 
		{
    
			"path": "pages/index/Index",
			"style": {
    
				"navigationBarTitleText": " Supply platform ",
				"navigationBarBackgroundColor": "#1C74BE",
				"navigationBarTextStyle": "white",
				"enablePullDownRefresh": false
			}
		}
	],
	// Subcontract load configuration 
	"subPackages": [
		//  Business side 
		{
    
			"root": "pages-merchants",// root directory 
			"pages": [{
    
					"path": "pages/home/Home",// The relative path under the root directory 
					"style": {
    
						"navigationBarTitleText": " Supply platform ",
						"navigationBarBackgroundColor": "#1C74BE",
						"navigationBarTextStyle": "white",
						"enablePullDownRefresh": false
					}
				}
				//...
			]
		},
		//  Warehouse side 
		{
    
			"root": "pages-warehouse",// root directory 
			"pages": [{
    
					"path": "pages/login/Login",// The relative path under the root directory 
					"style": {
    
						"navigationBarTitleText": " Sign in ",
						"navigationBarBackgroundColor": "#1C74BE",
						"navigationBarTextStyle": "white",
						"enablePullDownRefresh": false
					}
				},
				{
    
					"path": "pages/home/Home",// The relative path under the root directory 
					"style": {
    
						"navigationBarTitleText": " Supply platform ",
						"navigationBarBackgroundColor": "#1C74BE",
						"navigationBarTextStyle": "white",
						"enablePullDownRefresh": false
					}
				},
				//...
			]
		}
	],
	// Subcontract preload configuration 
	"preloadRule": {
    
		"pages-merchants/pages/home/Home": {
    // When rendering pages-merchants/pages/home/Home Load subpackages on 
			"network": "all",
			"packages": ["pages-merchants"]
		},
		"pages-warehouse/pages/login/Login": {
    // When rendering pages-warehouse/pages/login/Login Load subpackages on 
			"network": "all",
			"packages": ["pages-warehouse"]
		}
	},
	"easycom": {
    
		"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
	},
	"globalStyle": {
    
		"navigationBarTextStyle": "black",
		"navigationBarTitleText": "uni-app",
		"navigationBarBackgroundColor": "#F8F8F8",
		"backgroundColor": "#F8F8F8"
	},
	"condition": {
     // Mode configuration , Effective during development only 
		"current": 0, // Currently active mode (list  Index entry for )
		"list": [{
    
			"name": "", // Schema name 
			"path": "", // Launch page , Mandatory 
			"query": "" // Launch parameters , On page onLoad In the function, we get 
		}]
	}
}

stay manifest.json Add subcontracting optimization in
 Insert picture description here
Reference resources : https://blog.csdn.net/xiyunmengyuan/article/details/105409779

原网站

版权声明
本文为[Dependency_ Lai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270538335048.html