{"id":6736,"date":"2023-10-13T17:25:24","date_gmt":"2023-10-13T09:25:24","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=6736"},"modified":"2023-10-13T17:25:24","modified_gmt":"2023-10-13T09:25:24","slug":"vue%e7%9b%b4%e6%8e%a5%e8%bd%ac%e6%89%8b%e6%9c%baapp%e5%a6%82%e4%bd%95%e6%93%8d%e4%bd%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/6736\/","title":{"rendered":"vue\u76f4\u63a5\u8f6c\u624b\u673aapp\u5982\u4f55\u64cd\u4f5c\uff1f"},"content":{"rendered":"
Vue\u662f\u4e00\u79cd\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u6784\u5efa\u73b0\u4ee3\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u4f46\u662f\uff0c\u6709\u65f6\u5019\u4f60\u53ef\u80fd\u60f3\u8981\u5c06\u4f60\u7684Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210\u624b\u673a\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u5c06\u5176\u4f20\u64ad\u7ed9\u79fb\u52a8\u7528\u6237\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210\u624b\u673a\u5e94\u7528\u7a0b\u5e8f\u7684\u65b9\u6cd5\u3002<\/p>\n
\u9996\u5148\uff0c\u9700\u8981\u660e\u786e\u7684\u662f\uff0cVue\u5e94\u7528\u7a0b\u5e8f\u672c\u8eab\u5e76\u4e0d\u80fd\u76f4\u63a5\u8f6c\u6362\u6210\u624b\u673a\u5e94\u7528\u7a0b\u5e8f\u3002\u76f8\u53cd\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u4e00\u79cd\u79f0\u4e3a\u201c\u6df7\u5408\u5f00\u53d1\u201d\uff08Hybrid Development\uff09\u7684\u6280\u672f\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002\u6df7\u5408\u5f00\u53d1\u662f\u4e00\u79cd\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u7684\u65b9\u5f0f\uff0c\u4f7f\u5176\u53ef\u4ee5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u7528\u4e86\u4e00\u4e9b\u6846\u67b6\u548c\u5de5\u5177\uff0c\u4f8b\u5982Apache Cordova\u3001PhoneGap\u548cIonic\uff0c\u4ee5\u53ca\u4e00\u4e9bWeb\u6280\u672f\uff0c\u4f8b\u5982HTML\u3001CSS\u548cJavaScript\u3002<\/p>\n
Apache Cordova\u662f\u4e00\u4e2a\u7528\u4e8e\u6784\u5efa\u6df7\u5408\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u6e90\u6846\u67b6\u3002\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528JavaScript\u3001HTML\u548cCSS\u6784\u5efa\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\uff0c\u540c\u65f6\u4ecd\u7136\u53ef\u4ee5\u4f7f\u7528\u539f\u751fAPI\u548c\u63d2\u4ef6\u3002\u4f7f\u7528Cordova\uff0c\u60a8\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5305\u88c5\u5728\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u5e76\u5c06\u5176\u53d1\u5e03\u5230\u5e94\u7528\u5546\u5e97\u4e2d\u3002<\/p>\n
\u8981\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210Cordova\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n
1. \u5b89\u88c5Cordova<\/p>\n
\u9996\u5148\uff0c\u60a8\u9700\u8981\u5b89\u88c5Cordova\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528npm\uff08Node.js\u5305\u7ba1\u7406\u5668\uff09\u6765\u5b89\u88c5Cordova\u3002\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n
“`<\/p>\n
npm install -g cordova<\/p>\n
“`<\/p>\n
2. \u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee<\/p>\n
\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee\uff1a<\/p>\n
“`<\/p>\n
cordova crea<\/p>\n
te myapp com.example.myapp MyApp<\/p>\n “`<\/p>\n \u5176\u4e2d\uff0cmyapp\u662f\u60a8\u7684\u9879\u76ee\u540d\u79f0\uff0ccom.example.myapp\u662f\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u5305\u540d\uff0cMyApp\u662f\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u663e\u793a\u540d\u79f0\u3002<\/p>\n 3. \u6dfb\u52a0\u5e73\u53f0<\/p>\n \u5728\u60a8\u7684Cordova\u9879\u76ee\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6dfb\u52a0\u6240\u9700\u7684\u5e73\u53f0\uff1a<\/p>\n “`<\/p>\n cordova platform add ios<\/p>\n cordova platform add android<\/p>\n “`<\/p>\n \u8fd9\u5c06\u4e3a\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u6dfb\u52a0iOS\u548cAndroid\u5e73\u53f0\u3002<\/p>\n 4. \u6784\u5efa\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f<\/p>\n \u5728\u60a8\u7684Cordova\u9879\u76ee\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6784\u5efa\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n “`<\/p>\n cordova build<\/p>\n “`<\/p>\n \u8fd9\u5c06\u6784\u5efa\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u7f16\u8bd1\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n 5. \u6dfb\u52a0Vue\u5e94\u7528\u7a0b\u5e8f<\/p>\n \u5c06\u60a8\u7684Vue\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u590d\u5236\u5230Cordova\u9879\u76ee\u7684www\u76ee\u5f55\u4e2d\u3002<\/p>\n 6. \u542f\u52a8\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f<\/p>\n \u5728\u60a8\u7684Cordova\u9879\u76ee\u76ee\u5f55\u4e0b\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n “`<\/p>\n cordova run ios<\/p>\n cordova run androapp\u670d\u52a1\u5668\u600e\u4e48\u642d\u5efa<\/a>id<\/p>\n “`<\/p>\n \u8fd9\u5c06\u542f\u52a8\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5728\u6a21\u62df\u5668\u6216\u8bbe\u5907\u4e0a\u8fd0\u884c\u5b83\u3002<\/p>\n \u603b\u7ed3<\/p>\n \u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210\u624b\u673a\u5e94\u7528\u7a0b\u5e8f\u9700\u8981\u4f7f\u7528\u6df7\u5408\u5f00\u53d1\u6280\u672f\u3002\u4f7f\u7528Apache Cordova\uff0c\u60a8\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5305\u88c5\u5728\u4e00\u4e2a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u5e76\u5c06\u5176\u53d1\u5e03\u5230\u5e94\u7528\u5546\u5e97\u4e2d\u3002\u8981\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210Cordova\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u9700\u8981\u5b89\u88c5Cordoapp vue \u6846\u67b6<\/a>va\u3001\u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee\u3001\u6dfb\u52a0\u6240\u9700\u7684\u5e73\u53f0\u3001\u6784\u5efa\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3001\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6dfb\u52a0\u5230Cordova\u9879\u76ee\u4e2d\uff0c\u5e76\u542f\u52a8\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" Vue\u662f\u4e00\u79cd\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u6784\u5efa\u73b0\u4ee3\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002\u4f46\u662f\uff0c\u6709\u65f6\u5019\u4f60\u53ef\u80fd\u60f3\u8981\u5c06\u4f60\u7684Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u6210\u624b\u673a\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u5c06\u5176\u4f20\u64ad\u7ed9\u79fb\u52a8\u7528\u6237\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[10609,12136,12,105,425],"topic":[],"class_list":["post-6736","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-discuzapp","tag-vueapp","tag-12","tag-105","tag-425"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=6736"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6736\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=6736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=6736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=6736"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=6736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/figure>\n<\/p>\n