HbuilderX报错提示:pages.json tabBar[‘list‘][1][‘pagePath‘] “pages/sort/sort“ 需在 pages 数组中的解决方法

pages.json正确配置页面示例

"pages": [ //pages数组中第一项表示应用启动页
		{
			"path": "pages/home/home",
			"style": {
				"navigationBarTitleText": "首页"
			}
		},
    {//!!错误原因1:每新增一个.vue页面都要加这么一套
    	"path": "pages/sort/sort",
    	"style": {
    		"navigationBarTitleText": "分类"
    	}
    }
	],
	
  "tabBar": {//底部导航
    "selectedColor": "#50b686",
    "list": [
      {
        "pagePath": "pages/home/home",   //!!错误原因2:路径最前面不用加/
        "text": "首页",
        "iconPath": "static/tab_icons/main.png",
        "selectedIconPath": "static/tab_icons/main1.png"
      },
      {
        "pagePath": "pages/sort/sort",
        "text": "分类",
        "iconPath": "static/tab_icons/sort.png",
        "selectedIconPath": "static/tab_icons/sort1.png"
      }
    ]
  },

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