微信小程序分包

1、设置page.json

//page.json
{
//注册界面
	"pages": [
	{
		"path" : "pages/hot/hot",
		"style" : 
		{
			"navigationBarTitleText" : "",
			"enablePullDownRefresh" : false
		}
	},
	{
		"path" : "pages/hot-video/hot-video",
		"style" : 
		{
			"navigationBarTitleText" : "",
			"enablePullDownRefresh" : false
		}
	},
	{
		"path" : "pages/my/my",
		"style" : 
		{
			"navigationBarTitleText" : "",
			"enablePullDownRefresh" : false
		}
	}],
	"globalStyle": {
		"navigationBarTextStyle": "black",
		"navigationBarTitleText": "uni-app",
		"navigationBarBackgroundColor": "#F8F8F8",
		"backgroundColor": "#F8F8F8",
		"app-plus": {
			"background": "#efeff4"
		}
	},
	//底部导航
	"tabBar": {
		"selectedColor": "#f94d2a",
		"list": [
			{
				"pagePath": "pages/hot/hot",
				"text": "热搜",
				"iconPath": "static/tab-icons/hot.png",
				"selectedIconPath": "static/tab-icons/hot-active.png"
			},
			{
				"pagePath": "pages/hot-video/hot-video",
				"text": "热播",
				"iconPath": "static/tab-icons/hot-video.png",
				"selectedIconPath": "static/tab-icons/hot-video-active.png"
			},
			{
				"pagePath": "pages/my/my",
				"text": "我的",
				"iconPath": "static/tab-icons/my.png",
				"selectedIconPath": "static/tab-icons/my-active.png"
			}
		]
	},
	// 分包
	"subPackages": [
		{
			"root": "subpkg",  //分包包名
			"name":"sub-1",   //分包别名
			"pages": [   //分包下的页面
				{
					"path": "pages/my/my"  ,//分包下的页面路径
					"style": { //页面的样式
						"navigationBarTitleText": "文章搜索"
						
					}
				}
			
			]
		}
	]
}

2、设置分包对应目录

微信小程序分包_第1张图片

3、运行到微信开发者工具查看

微信小程序分包_第2张图片

你可能感兴趣的:(uniapp,微信小程序,小程序)