{"id":18065,"date":"2026-03-03T17:23:23","date_gmt":"2026-03-03T09:23:23","guid":{"rendered":"https:\/\/www.yimenyun.ltd\/ezhan\/?p=18065"},"modified":"2026-03-03T17:23:23","modified_gmt":"2026-03-03T09:23:23","slug":"vue%e5%81%9a%e5%ae%89%e5%8d%93app%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.ltd\/ezhan\/18065\/","title":{"rendered":"vue\u505a\u5b89\u5353app\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"<p>Vue\u662f\u4e00\u6b3e\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u3002Vu<a href=\"https:\/\/www.yimenapp.cn\/fengzhuang-3485.html\">chrome \u7f51\u9875\u505a\u6210app<\/a>e\u7684\u8bbe\u8ba1\u7406\u5ff5\u662f\u6613\u4e8e\u7406\u89e3\u3001\u6613\u4e8e\u4f7f\u7528\u3001\u6613\u4e8e\u6269\u5c55\u3002Vue\u901a\u8fc7\u5c06\u89c6\u56fe\u5c42\u4e0e\u6570\u636e\u5c42\u5206\u79bb\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u52a0\u4e13\u6ce8\u4e8e\u4e1a\u52a1\u903b\u8f91\u7684\u5b9e\u73b0\u3002\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d\uff0cVue\u53ef\u4ee5\u4e0eCordova\u6846\u67b6\u7ed3\u5408\u4f7f\u7528\uff0c\u5c06Vue\u5e94\u7528\u6253\u5305\u6210\u5b89\u5353\u5e94\u7528\u3002<\/p>\n<p>Cordova\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528HTML\u3001CSS\u3001JavaScript\u7b49Web\u6280\u672f\u5f00\u53d1\u539f\u751f\u79fb\u52a8\u5e94\u7528\u3002Cordova\u63d0\u4f9b\u4e86\u8bb8\u591a\u63d2\u4ef6\uff0c\u7528\u4e8e\u8bbf\u95ee\u8bbe\u5907\u786c\u4ef6\u548c\u539f\u751f\u529f\u80fd\uff0c\u4f8b\u5982\u6444\u50cf\u5934\u3001\u5730\u7406\u4f4d\u7f6e\u3001\u6587\u4ef6\u7cfb\u7edf\u7b49\u3002Cordova\u8fd8\u63d0\u4f9b\u4e86\u4e00\u79cd\u5c06Web\u5e94\u7528\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7684\u65b9\u6cd5\uff0c\u5373\u4f7f\u7528Cordova CLI\u547d\u4ee4\u884c\u5de5\u5177\u5c06Web\u5e94\u7528\u6253\u5305\u6210\u5b89\u5353\u5e94\u7528\u3002<\/p>\n<p>\u5c06Vue\u5e94\u7528\u6253\u5305\u6210\u5b89\u5353\u5e94\u7528\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p>1. \u521b\u5efaVue\u9879\u76ee<\/p>\n<p>\u4f7f\u7528Vue CLI\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Vue\u9879\u76ee\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>vue create my-app<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u5b89\u88c5Cordova\u63d2\u4ef6<\/p>\n<p>\u5728Vue\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Cordova\u63d2\u4ef6\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm install -g cordova<\/p>\n<p>&#8220;`<\/p>\n<p>3. \u521b\u5efaCordova\u9879\u76ee<\/p>\n<p>\u5728Vue\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efaCordova\u9879\u76ee\uff1a<\/p>\n<p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/21\/14\/10039426769.jpg\" \/><\/figure>\n<\/p>\n<p>&#8220;`<\/p>\n<p>cordova create my-app com.example.myapp MyApp<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmy-app\u4e3a\u9879\u76ee\u540d\u79f0\uff0ccom.example.myapp\u4e3a\u5305\u540d\uff0cMyApp\u4e3a\u5e94\u7528\u540d\u79f0\u3002<\/p>\n<p>4. \u6dfb\u52a0\u5e73\u53f0<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0\u5b89\u5353\u5e73\u53f0\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cd my-app<\/p>\n<p>cordova platform add android<\/p>\n<p>&#8220;`<\/p>\n<p>5. \u6784\u5efaVue\u5e94\u7528<\/p>\n<p>\u5728Vue\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6784\u5efaVue\u5e94\u7528\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm run build<\/p>\n<p>&#8220;`<\/p>\n<p>6. \u5c06Vue\u5e94\u7528\u590d\u5236\u5230Cordova\u9879\u76ee<\/p>\n<p>\u5c06Vue\u5e94\u7528\u6784\u5efa\u751f\u6210\u7684dist\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u590d\u5236\u5230Cordova\u9879\u76ee\u7684www\u76ee\u5f55\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cp -r dist\/* my-app\/www\/<\/p>\n<p>&#8220;`<\/p>\n<p>7. \u6253\u5305\u5b89\u5353\u5e94\u7528<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5305\u5b89\u5353\u5e94\u7528\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova build android<\/p>\n<p>&#8220;`<\/p>\n<p>\u6253\u5305\u5b8c\u6210\u540e\uff0c\u5728Cordova\u9879\u76ee\u7684platforms\/android\/app\/build\/outputs\/apk\u76ee\u5f55\u4e0b\u53ef\u4ee5\u627e\u5230\u751f\u6210\u7684\u5b89\u5353\u5e94\u7528\u6587\u4ef6\u3002<\/p>\n<p>\u603b\u7ed3\uff1aVue\u4e0eCordova\u7ed3\u5408\u4f7f\u7528\u53ef\u4ee5\u5feb\u901f\u5730\u5c06Vue\u5e94\u7528\u6253\u5305\u6210\u5b89\u5353\u5e94\u7528\u3002\u4f7f\u7528Vue\u5f00\u53d1\u5b89\u5353\u5e94\u7528\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528Vue\u7684<a href=\"https:\/\/www.yimenapp.cn\/fengzhuang-3466.html\">android\u5f71\u89c6app\u5f00\u53d1<\/a>\u4f18\u52bf\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vue\u662f\u4e00\u6b3e\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u3002Vue\u7684\u8bbe\u8ba1\u7406\u5ff5\u662f\u6613\u4e8e\u7406\u89e3\u3001\u6613\u4e8e\u4f7f\u7528\u3001\u6613\u4e8e\u6269\u5c55\u3002Vue\u901a\u8fc7\u5c06\u89c6\u56fe\u5c42\u4e0e\u6570\u636e\u5c42\u5206\u79bb\uff0c\u4f7f\u5f97\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u52a0\u4e13\u6ce8\u4e8e\u4e1a\u52a1\u903b\u8f91\u7684\u5b9e\u73b0\u3002\u5728\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u4e2d<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[19513,624,19512,13401,609],"topic":[],"class_list":["post-18065","post","type-post","status-publish","format-standard","hentry","category-appkaifa","tag-app-","tag-624","tag-app","tag-13401","tag-609"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/posts\/18065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/comments?post=18065"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/posts\/18065\/revisions"}],"predecessor-version":[{"id":18068,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/posts\/18065\/revisions\/18068"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/media?parent=18065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/categories?post=18065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/tags?post=18065"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.ltd\/ezhan\/wp-json\/wp\/v2\/topic?post=18065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}