uni-app的分包下小程序报错app.json: [“tabBar“][1][“pagePath“]: “xxxx“ need in [“pages“]

最近接触到一个项目,出现这样的报错查找一下发现项目中分包把tabbar中的list部分pagePath写成package_run/pages/run/run。

在tabbar中不支持这样的。只能在pages中定义入口文件。具体代码如下:

{
			"path" : "pages/run/run",//需要分包的入口只能在pages中而不是在分包的subPackages中
			"style" : 
			{
				"navigationBarTitleText" : "跑腿",
				"enablePullDownRefresh" : false
			}
		}
	],
	"subPackages": [
		{
			"root": "package_run",
			"pages": [
				{
					"path": "pages/run-orders/run-orders",
					"style": {
						"enablePullDownRefresh": false,
						"navigationBarTitleText" : "跑腿订单"
					}
				},
				{
					"path" : "pages/join-rider/join-rider",
					"style" : 
					{
						"navigationBarTitleText" : "加入骑手",
						"enablePullDownRefresh" : false
					}
				}
			]
		}
	],
	"globalStyle": {
		// 导航栏标题颜色及状态栏前景颜色,仅支持 black/white
		"navigationBarTextStyle": "white",
		// 导航栏标题文字内容
		"navigationBarTitleText": "考拉外卖",
		// 导航栏背景颜色(同状态栏背景色)
		"navigationBarBackgroundColor": "#ffd100",
		//  下拉显示出来的窗口的背景色
		"backgroundColor": "#F8F8F8"
	},
	"tabBar": {
		"backgroundColor": "#fff",
		"selectedColor": "#ffd100",
		"color": "#666",
		"list": [
			{
				"iconPath": "/static/icons/home.png",
				"selectedIconPath": "static/icons/home-active.png",
				"text": "首页",
				"pagePath": "pages/index/index"
			},
			{
				"iconPath": "/static/icons/run.png",
				"selectedIconPath": "static/icons/run-selected.png",
				"text": "跑腿",
				"pagePath": "pages/run/run"
			},
			{
				"iconPath": "/static/icons/orders.png",
				"selectedIconPath": "static/icons/orders-active.png",
				"text": "订单",
				"pagePath": "pages/orders/orders"
			},
			{
				"iconPath": "/static/icons/me.png",
				"selectedIconPath": "static/icons/me-active.png",
				"text": "我的",
				"pagePath": "pages/me/me"
			}
		]
	},

  

posted @ 2024-04-22 10:08  圣迭戈  阅读(641)  评论(0)    收藏  举报