uni-app分包 subPackages,preloadRule ,小程序报错[ app.json 文件内容错误] app.json: [“pages“][2]: “pages/login...

1.创建项目+创建
uni-app分包 subPackages,preloadRule ,小程序报错[ app.json 文件内容错误] app.json: [“pages“][2]: “pages/login..._第1张图片
2.在pages.jison修改

 "subPackages": [
		     {
		       "name": "login",
		       "root": "pages/login",
		       "pages": [
		         {
		           "path": "login",
		           "style": {
		             "navigationBarTitleText": "",
		             "enablePullDownRefresh": false
		           }
		         }
		       ]
		     },
			 {
			   "name": "home",
			   "root": "pages/home",
			   "pages": [
			     {
			       "path": "home",
			       "style": {
			         "navigationBarTitleText": "",
			         "enablePullDownRefresh": false
			       }
			     }
			   ]
			 },
			 
			 {
			   "name": "lest",
			   "root": "pages/lest",
			   "pages": [
			     {
			       "path": "lest",
			       "style": {
			         "navigationBarTitleText": "",
			         "enablePullDownRefresh": false
			       }
			     }
			   ]
			 }
	 ],
	   "preloadRule": {
	     "pages/home/home": {
	       "network": "all",
	       "packages": ["login", "home", "lest"]
	     }
	   },

运行到小程序就完成分包了
uni-app分包 subPackages,preloadRule ,小程序报错[ app.json 文件内容错误] app.json: [“pages“][2]: “pages/login..._第2张图片
!!!注意,在分包时pages删除subPackages配置的地址,不然要报错哦~
uni-app分包 subPackages,preloadRule ,小程序报错[ app.json 文件内容错误] app.json: [“pages“][2]: “pages/login..._第3张图片

你可能感兴趣的:(uni-app,uni-app,vue)