一开始提示 Error: app,json: ["tabBar"][1]["pagePath"]: "packageA/pages/about/about" need in ["pages"] File: app.json
(您遇到的错误提示表明,在 app.json
文件的 tabBar
配置中指定的页面路径 "packageA/pages/about/about"
不在 pages
数组中定义。具体来说,tabBar
中引用的页面路径必须是在 app.json
文件的 pages
数组中声明过的路径。)
我就加了声明 subpackages,但是又出现提示 Error: app,json: ["pages"][1]: "packageA/pages/about/about" ShouId not exist in ["subPackages"][0]File: appjson
初学小白,请教,谢谢!
代码如下:
{
"pages": [
"pages/index/index"
],
"subpackages": [
{
"root": "packageA",
"pages": [
"pages/preview/preview",
"pages/about/about"
]
}
],
"tabBar": {
"color": "#999999",
"selectedColor": "#07C160",
"backgroundColor": "#ffffff",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "images/home.png",
"selectedIconPath": "images/home-active.png"
},
{
"pagePath": "packageA/pages/about/about",
"text": "关于",
"iconPath": "images/about.png",
"selectedIconPath": "images/about-active.png"
}
]
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你的 pages 只声明了一个 path 。
全放到pages里去试试。