{"id":217971,"date":"2024-05-11T17:24:23","date_gmt":"2024-05-11T09:24:23","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/217971.html"},"modified":"2024-05-11T17:24:28","modified_gmt":"2024-05-11T09:24:28","slug":"%e5%be%ae%e4%bf%a1%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%bc%80%e5%8f%91%e4%b8%ad%ef%bc%8capp-json%e5%92%8cpages-json%e6%96%87%e4%bb%b6%e9%83%bd%e8%a6%81%e6%9c%89%e5%90%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/217971.html","title":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0capp.json\u548cpages.json\u6587\u4ef6\u90fd\u8981\u6709\u5417"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27122422\/cbf28ed7-2ef5-4644-b96a-01b4b5f1bcf5.webp\" alt=\"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0capp.json\u548cpages.json\u6587\u4ef6\u90fd\u8981\u6709\u5417\" \/><\/p>\n<p><p>\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0c<strong>app.json\u548cpages.json\u6587\u4ef6\u90fd\u5fc5\u987b\u5b58\u5728<\/strong>\u3002app.json\u662f\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u4e2d\u5b9a\u4e49\u4e86\u5c0f\u7a0b\u5e8f\u7684\u4e00\u7cfb\u5217\u7684\u5168\u5c40\u8bbe\u7f6e\uff0c\u5982\u9875\u9762\u8def\u5f84\u3001\u754c\u9762\u8868\u73b0\u3001\u7f51\u7edc\u8d85\u65f6\u65f6\u95f4\u7b49\u3002\u800cpages.json\u5219\u8d1f\u8d23\u5404\u4e2a\u9875\u9762\u7684\u5177\u4f53\u914d\u7f6e\uff0c\u5982\u9875\u9762\u7684\u8def\u5f84\u3001\u7a97\u53e3\u8868\u73b0\u3001\u8bbe\u7f6e\u5bfc\u822a\u6761\u7b49\u3002\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5171\u540c\u5de5\u4f5c\uff0c\u786e\u4fdd\u5c0f\u7a0b\u5e8f\u7ed3\u6784\u7684\u6e05\u6670\u548c\u529f\u80fd\u7684\u5b9e\u73b0\u3002<strong>\u7279\u522b\u5730\uff0cpages.json\u5e76\u975e\u5728\u6240\u6709\u5c0f\u7a0b\u5e8f\u9879\u76ee\u7ed3\u6784\u4e2d\u90fd\u5b58\u5728<\/strong>\uff0c\u5176\u5b9e\u9645\u51fa\u73b0\u53d6\u51b3\u4e8e\u5f00\u53d1\u8005\u91c7\u7528\u7684\u6846\u67b6\u6216\u8bbe\u8ba1\u7406\u5ff5\u3002\u5728\u4e00\u4e9b\u6846\u67b6\u4e2d\uff0c\u4f8b\u5982uni-app\uff0c\u4f1a\u4f7f\u7528pages.json\u6765\u5bf9\u9875\u9762\u8fdb\u884c\u914d\u7f6e\uff0c\u800c\u4e0d\u662f\u5728app.json\u4e2d\u76f4\u63a5\u5b9a\u4e49\u6240\u6709\u9875\u9762\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0capp.json\u6587\u4ef6\u626e\u6f14\u7740\u6781\u5176\u91cd\u8981\u7684\u89d2\u8272\u3002\u5b83\u662f\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u8fc7\u5b9a\u4e49\u5c0f\u7a0b\u5e8f\u7684\u7a97\u53e3\u80cc\u666f\u8272\u3001\u5bfc\u822a\u6761\u6837\u5f0f\u3001\u9ed8\u8ba4\u9875\u9762\u7b49\u8bbe\u7f6e\uff0c\u5b83\u4e3a\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u98ce\u683c\u548c\u6807\u51c6\u3002\u8fd9\u4e0d\u4ec5\u4ec5\u662f\u4e3a\u4e86\u7f8e\u89c2\u548c\u7528\u6237\u4f53\u9a8c\uff0c\u66f4\u91cd\u8981\u7684\u662f\uff0c\u901a\u8fc7\u8fd9\u4e9b\u5168\u5c40\u8bbe\u7f6e\uff0c\u53ef\u4ee5\u51cf\u5c11\u5728\u6bcf\u4e2a\u9875\u9762\u5185\u91cd\u590d\u914d\u7f6e\u7684\u9700\u8981\uff0c\u4ece\u800c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u7ef4\u62a4\u65b9\u4fbf\u6027\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001APP.JSON\u6587\u4ef6\u89e3\u6790<\/h2>\n<\/p>\n<p><p>App.json\u6587\u4ef6\u4f5c\u4e3a\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u662f\u6bcf\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u90e8\u5206\u3002\u5b83\u4e3a\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u8fd0\u884c\u63d0\u4f9b\u4e86\u5fc5\u8981\u7684\u4fe1\u606f\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5c0f\u7a0b\u5e8f\u9875\u9762\u8def\u5f84<\/strong>\uff1aApp.json\u4e2d\u7684pages\u6570\u7ec4\u662f\u5fc5\u987b\u8bbe\u7f6e\u7684\uff0c\u5b83\u7528\u4e8e\u5b9a\u4e49\u5c0f\u7a0b\u5e8f\u7684\u9875\u9762\u8def\u5f84\u3002\u8fd9\u4e2a\u5217\u8868\u987a\u5e8f\u4ee3\u8868\u4e86\u5c0f\u7a0b\u5e8f\u7684\u9875\u9762\u52a0\u8f7d\u987a\u5e8f\uff0c\u7b2c\u4e00\u4e2a\u9875\u9762\u4e3a\u5c0f\u7a0b\u5e8f\u7684\u9ed8\u8ba4\u9996\u9875\u3002\u8fd9\u662f\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7ed3\u6784\u7684\u57fa\u7840\uff0c\u76f4\u63a5\u5f71\u54cd\u7528\u6237\u6253\u5f00\u5c0f\u7a0b\u5e8f\u65f6\u7684\u9996\u6b21\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7a97\u53e3\u8868\u73b0<\/strong>\uff1a\u5728app.json\u4e2d\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u7a97\u53e3\u80cc\u666f\u8272\u3001\u6587\u5b57\u989c\u8272\u7b49\u9875\u9762\u8868\u73b0\u5f62\u5f0f\u3002\u8fd9\u5bf9\u4e8e\u786e\u4fdd\u5c0f\u7a0b\u5e8f\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u6709\u7edf\u4e00\u7684\u89c6\u89c9\u4f53\u9a8c\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h2>\u4e8c\u3001PAGES.JSON\u6587\u4ef6\u7279\u70b9<\/h2>\n<\/p>\n<p><p>\u5728\u4e00\u4e9b\u7279\u5b9a\u7684\u6846\u67b6\u4e0b\uff0c\u6bd4\u5982\u4f7f\u7528uni-app\u8fdb\u884c\u5f00\u53d1\u65f6\uff0cpages.json\u6587\u4ef6\u8d77\u5230\u4e86\u91cd\u8981\u4f5c\u7528\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u96c6\u4e2d\u7684\u9875\u9762\u914d\u7f6e\u65b9\u6cd5\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u5728\u4e00\u4e2a\u6587\u4ef6\u91cc\u914d\u7f6e\u6240\u6709\u9875\u9762\u7684\u8def\u7531\u3001\u754c\u9762\u8868\u73b0\u4ee5\u53ca\u5176\u4ed6\u5c5e\u6027\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u9875\u9762\u8def\u7531\u914d\u7f6e<\/strong>\uff1a\u901a\u8fc7\u5728pages.json\u6587\u4ef6\u4e2d\u5b9a\u4e49\u9875\u9762\u8def\u5f84\u548c\u540d\u79f0\uff0c\u5b9e\u73b0\u9875\u9762\u7684\u5feb\u901f\u914d\u7f6e\u548c\u4fee\u6539\u3002\u8fd9\u5bf9\u4e8e\u5927\u578b\u9879\u76ee\u6216\u9700\u8981\u9891\u7e41\u4fee\u6539\u9875\u9762\u8def\u5f84\u7684\u9879\u76ee\u5c24\u4e3a\u91cd\u8981\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u754c\u9762\u8868\u73b0\u914d\u7f6e<\/strong>\uff1a\u4e0eapp.json\u7c7b\u4f3c\uff0cpages.json\u4e5f\u5141\u8bb8\u5f00\u53d1\u8005\u5bf9\u6bcf\u4e2a\u9875\u9762\u7684\u72b6\u6001\u680f\u3001\u5bfc\u822a\u680f\u7b49\u8fdb\u884c\u4e2a\u6027\u5316\u8bbe\u7f6e\uff0c\u4f7f\u9875\u9762\u98ce\u683c\u66f4\u52a0\u7b26\u5408\u9879\u76ee\u8981\u6c42\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h2>\u4e09\u3001\u4e8c\u8005\u5728\u5f00\u53d1\u4e2d\u7684\u5b9e\u9645\u5e94\u7528<\/h2>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u7684\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0capp.json\u548cpages.json\uff08\u5982\u679c\u4f7f\u7528\uff09\u7684\u6709\u6548\u5229\u7528\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u540c\u65f6\u4e5f\u4f7f\u9879\u76ee\u7ed3\u6784\u66f4\u52a0\u6e05\u6670\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5168\u5c40\u4e0e\u5c40\u90e8\u8bbe\u7f6e\u7ed3\u5408<\/strong>\uff1a\u901a\u8fc7\u5168\u5c40\u7684app.json\u914d\u7f6e\u4e0e\u9488\u5bf9\u7279\u5b9a\u9875\u9762\u7684pages.json\u914d\u7f6e\u76f8\u7ed3\u5408\uff0c\u53ef\u4ee5\u7075\u6d3b\u63a7\u5236\u5c0f\u7a0b\u5e8f\u7684\u8868\u73b0\u548c\u884c\u4e3a\u3002\u8fd9\u79cd\u8bbe\u8ba1\u65e2\u4fdd\u8bc1\u4e86\u5168\u5c40\u8bbe\u7f6e\u7684\u4e00\u81f4\u6027\uff0c\u53c8\u4fdd\u7559\u4e86\u5bf9\u4e2a\u522b\u9875\u9762\u7279\u6b8a\u5904\u7406\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5feb\u901f\u8fed\u4ee3\u4e0e\u66f4\u65b0<\/strong>\uff1a\u5728\u9879\u76ee\u9700\u8981\u66f4\u65b0\u6216\u8fed\u4ee3\u65f6\uff0c\u6709\u4e86\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u5408\u7406\u914d\u7f6e\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5feb\u901f\u5730\u5bf9\u5c0f\u7a0b\u5e8f\u8fdb\u884c\u8c03\u6574\uff0c\u5982\u589e\u52a0\u9875\u9762\u3001\u4fee\u6539\u754c\u9762\u98ce\u683c\u7b49\uff0c\u65e0\u9700\u8fdb\u884c\u5927\u89c4\u6a21\u7684\u4ee3\u7801\u91cd\u6784\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h2>\u56db\u3001\u7ed3\u8bba<\/h2>\n<\/p>\n<p><p>\u7efc\u4e0a\u6240\u8ff0\uff0capp.json\u548cpages.json\u6587\u4ef6\u90fd\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u53d1\u6325\u7740\u4e0d\u53ef\u6216\u7f3a\u7684\u4f5c\u7528\u3002\u5c3d\u7ba1pages.json\u7684\u4f7f\u7528\u53d6\u51b3\u4e8e\u5f00\u53d1\u6846\u67b6\u548c\u9879\u76ee\u9700\u6c42\uff0c\u4f46app.json\u4f5c\u4e3a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\u6838\u5fc3\uff0c\u662f\u6bcf\u4e2a\u5c0f\u7a0b\u5e8f\u9879\u76ee\u5fc5\u5907\u7684\u6587\u4ef6\u3002\u6b63\u786e\u5730\u7406\u89e3\u548c\u4f7f\u7528\u8fd9\u4e24\u4e2a\u6587\u4ef6\uff0c\u5bf9\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3001\u4f18\u5316\u9879\u76ee\u7ed3\u6784\u3001\u4fdd\u8bc1\u5c0f\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u90fd\u6709\u7740\u81f3\u5173\u91cd\u8981\u7684\u5f71\u54cd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. \u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0c\u4e3a\u4ec0\u4e48\u9700\u8981app.json\u548cpages.json\u6587\u4ef6\uff1f<\/strong><\/p>\n<p>\u5728\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0capp.json\u548cpages.json\u6587\u4ef6\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u914d\u7f6e\u6587\u4ef6\u3002app.json\u6587\u4ef6\u7528\u4e8e\u914d\u7f6e\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u914d\u7f6e\uff0c\u5305\u62ec\u5c0f\u7a0b\u5e8f\u7684\u540d\u79f0\u3001icon\u3001\u7a97\u53e3\u6a21\u5f0f\u3001\u9875\u9762\u80cc\u666f\u8272\u3001\u5e95\u90e8\u5bfc\u822a\u680f\u7b49\u4fe1\u606f\u3002\u800cpages.json\u6587\u4ef6\u5219\u7528\u4e8e\u914d\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762\uff0c\u5305\u62ec\u9875\u9762\u8def\u5f84\u3001\u9875\u9762\u6807\u9898\u3001\u9875\u9762\u7684\u5bfc\u822a\u680f\u80cc\u666f\u8272\u7b49\u4fe1\u606f\u3002<\/p>\n<p><strong>2. app.json\u548cpages.json\u6587\u4ef6\u7684\u4f5c\u7528\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><\/p>\n<p>app.json\u6587\u4ef6\u662f\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u4e8e\u914d\u7f6e\u6574\u4e2a\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u5171\u4eab\u5c5e\u6027\u3002\u5728app.json\u6587\u4ef6\u4e2d\u53ef\u4ee5\u8bbe\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5982\u540d\u79f0\u3001icon\u3001\u7a97\u53e3\u6a21\u5f0f\u7b49\u3002\u800cpages.json\u6587\u4ef6\u662f\u9875\u9762\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u4e8e\u914d\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u5404\u4e2a\u9875\u9762\u3002\u5728pages.json\u6587\u4ef6\u4e2d\u53ef\u4ee5\u8bbe\u7f6e\u6bcf\u4e2a\u9875\u9762\u7684\u8def\u5f84\u3001\u6807\u9898\u3001\u5bfc\u822a\u680f\u80cc\u666f\u8272\u7b49\u3002<\/p>\n<p><strong>3. \u82e5\u4e0d\u7f16\u5199app.json\u548cpages.json\u6587\u4ef6\u4f1a\u6709\u4ec0\u4e48\u5f71\u54cd\uff1f<\/strong><\/p>\n<p>\u82e5\u4e0d\u7f16\u5199app.json\u548cpages.json\u6587\u4ef6\uff0c\u5c06\u65e0\u6cd5\u6b63\u786e\u914d\u7f6e\u5c0f\u7a0b\u5e8f\u7684\u5168\u5c40\u5c5e\u6027\u548c\u9875\u9762\u5c5e\u6027\u3002\u7f3a\u5c11app.json\u6587\u4ef6\uff0c\u5c0f\u7a0b\u5e8f\u5c06\u65e0\u6cd5\u6b63\u786e\u83b7\u53d6\u5c0f\u7a0b\u5e8f\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5982\u540d\u79f0\u3001\u56fe\u6807\u7b49\u3002\u7f3a\u5c11pages.json\u6587\u4ef6\uff0c\u5c0f\u7a0b\u5e8f\u5c06\u65e0\u6cd5\u6b63\u786e\u6e32\u67d3\u6bcf\u4e2a\u9875\u9762\uff0c\u5e76\u4e14\u9875\u9762\u4e4b\u95f4\u65e0\u6cd5\u6b63\u786e\u5207\u6362\u3002\u56e0\u6b64\uff0c\u7f16\u5199\u6b63\u786e\u7684app.json\u548cpages.json\u6587\u4ef6\u5bf9\u4e8e\u5c0f\u7a0b\u5e8f\u6b63\u5e38\u8fd0\u884c\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5fae\u4fe1\u5c0f\u7a0b\u5e8f\u5f00\u53d1\u4e2d\uff0capp.json\u548cpages.json\u6587\u4ef6\u90fd\u5fc5\u987b\u5b58\u5728\u3002app.json\u662f\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u4e2d\u5b9a [&hellip;]","protected":false},"author":3,"featured_media":217980,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/217971"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=217971"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/217971\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/217980"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=217971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=217971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=217971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}