{"id":6737,"date":"2023-10-13T17:25:23","date_gmt":"2023-10-13T09:25:23","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=6737"},"modified":"2023-10-13T17:25:23","modified_gmt":"2023-10-13T09:25:23","slug":"vue%e5%a6%82%e4%bd%95%e6%89%93%e5%8c%85app%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/6737\/","title":{"rendered":"vue\u5982\u4f55\u6253\u5305app\uff1f"},"content":{"rendered":"

Vue\u662f\u4e00\u79cd\u73b0\u4ee3\u5316\u7684JavaScript\u6846\u67b6\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u548c\u5355\u9875\u5e94\u7528\u7a0b\u5e8f\uff08SPA\uff09\u3002Vue\u5177\u6709\u9ad8\u6548\u3001\u7075\u6d3b\u548c\u6613\u4e8e\u4f7f\u7528\u7684\u7279\u70b9\uff0c\u56e0\u6b64\u6210\u4e3a\u4e86\u4f17\u591a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002\u800c\u4e14\uff0cVue\u8fd8\u652f\u6301\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u3002\u672c\u6587\u5c06\u4ecb\u7ecdVue\u5982\u4f55\u6253\u5305\u6210App\u3002<\/p>\n

\u6253\u5305App\u7684\u539f\u7406<\/p>\n

Vue\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u662f\u5728Web\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u7684\uff0c\u4f46\u662fVue\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u6253\u5305Vue\u5e94\u7528\u7a0b\u5e8f\u4e3a\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Cordova\u6216Ionic\uff0c\u5e76\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165\u5230\u8fd9\u4e9b\u5e73\u53f0\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3002Cordova\u548cIonic\u90fd\u662f\u8de8\u5e73\u53f0\u7684\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u4eec\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528Web\u6280\u672f\uff08\u5982HTML\u3001CSS\u548cJavaScript\uff09\u6765\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e9b\u6846\u67b6\u63d0\u4f9b\u4e86\u8bb8\u591a\u539f\u751fAPI\uff0c\u4ee5\u4fbf\u5f00\u53d1\u8005\u53ef\u4ee5\u8bbf\u95ee\u8bbe\u5907\u7684\u786c\u4ef6\u548c\u8f6f\u4ef6\u529f\u80fd\u3002<\/p>\n

\u6253\u5305App\u7684\u6b65\u9aa4<\/p>\n

\u4e0b\u9762\u662f\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\uff1a<\/p>\n

\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5Cordova\u6216Ionic<\/p>\n

\u8981\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5Cordova\u6216Ionic\u3002\u8fd9\u4e24\u4e2a\u6846\u67b6\u90fd\u662f\u57fa\u4e8eNode.js\u7684\uff0c\u56e0\u6b64\u9996\u5148\u9700\u8981\u5b89\u88c5Node.js\u3002\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528npm\uff08Node.js\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\uff09\u6765\u5b89\u88c5Cordova\u6216Ionic\u3002\u8981\u5b89\u88c5Cordova\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

npm install -g cordova<\/p>\n

“`<\/p>\n

\u8981\u5b89\u88c5Ionic\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

npm insta<\/p>\n

<\/figure>\n<\/p>\n

ll -g ionic<\/p>\n

“`<\/p>\n

\u7b2c\u4e8c\u6b65\uff1a\u521b\u5efa\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u5b89\u88c5\u5b8c\u6210Cordova\u6216Ionic\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b83\u4eec\u6765\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Cordovhtml5\u5c01\u88c5app<\/a>a\u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

cordova create myapp<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cmyapp\u662f\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3002\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Ionic\u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

ionic start myapp<\/p>\n

“`<\/p>\n

\u540c\u6837\uff0cmyapp\u662f\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3002\u521b\u5efa\u5e94\u7528\u7a0b\u5e8f\u540e\uff0c\u8fdb\u5165\u5e94\u7528\u7a0b\u5e8f\u7684\u76ee\u5f55\u3002<\/p>\n

\u7b2c\u4e09\u6b65\uff1a\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d<\/p>\n

\u8981\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165\u5230Cordova\u6216Ionic\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u7684\u4ee3\u7801\u590d\u5236\u5230\u5e94\u7528\u7a0b\u5e8f\u7684www\u76ee\u5f55\u4e2d\u3002\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u7684\u7528\u6237\u754c\u9762\u548c\u903b\u8f91\u3002<\/p>\n

\u7b2c\u56db\u6b65\uff1a\u6dfb\u52a0\u539f\u751f\u63d2\u4ef6<\/p>\n

Corandroid\u52a8\u6548\u5f00\u53d1<\/a>dova\u548cIonic\u90fd\u63d0\u4f9b\u4e86\u8bb8\u591a\u539f\u751f\u63d2\u4ef6\uff0c\u7528\u4e8e\u8bbf\u95ee\u8bbe\u5907\u7684\u786c\u4ef6\u548c\u8f6f\u4ef6\u529f\u80fd\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u63d2\u4ef6\u6765\u8bbf\u95ee\u76f8\u673a\u3001GPS\u3001\u8054\u7cfb\u4eba\u7b49\u3002\u8981\u6dfb\u52a0\u4e00\u4e2a\u539f\u751f\u63d2\u4ef6\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

cordova plugin add plugin-name<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cplugin-name\u662f\u63d2\u4ef6\u7684\u540d\u79f0\u3002\u8981\u67e5\u627e\u53ef\u7528\u7684\u63d2\u4ef6\uff0c\u8bf7\u8bbf\u95eeCordova\u6216Ionic\u7684\u5b98\u65b9\u6587\u6863\u3002<\/p>\n

\u7b2c\u4e94\u6b65\uff1a\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u662f\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u7684\u6700\u540e\u4e00\u6b65\u3002\u8981\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

cordova build platform<\/p>\n

“`<\/p>\n

\u5176\u4e2d\uff0cplatform\u662f\u76ee\u6807\u5e73\u53f0\u7684\u540d\u79f0\uff0c\u4f8b\u5982android\u6216ios\u3002\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u540e\uff0c\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u7684platforms\u76ee\u5f55\u4e2d\u627e\u5230\u751f\u6210\u7684\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u4f7f\u7528Cordova\u6216Ionic\uff0c\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165\u5230\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u5e76\u8bbf\u95ee\u8bbe\u5907\u7684\u786c\u4ef6\u548c\u8f6f\u4ef6\u529f\u80fd\u3002\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\u5305\u62ec\u5b89\u88c5Cordova\u6216Ionic\u3001\u521b\u5efa\u5e94\u7528\u7a0b\u5e8f\u3001\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u5d4c\u5165\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\u3001\u6dfb\u52a0\u539f\u751f\u63d2\u4ef6\u548c\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Vue\u662f\u4e00\u79cd\u73b0\u4ee3\u5316\u7684JavaScript\u6846\u67b6\uff0c\u5b83\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa\u7528\u6237\u754c\u9762\u548c\u5355\u9875\u5e94\u7528\u7a0b\u5e8f\uff08SPA\uff09\u3002Vue\u5177\u6709\u9ad8\u6548\u3001\u7075\u6d3b\u548c\u6613\u4e8e\u4f7f\u7528\u7684\u7279\u70b9\uff0c\u56e0\u6b64\u6210\u4e3a\u4e86\u4f17\u591a\u5f00\u53d1\u8005\u7684\u9996\u9009\u3002\u800c\u4e14\uff0cVue\u8fd8\u652f\u6301\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u3002<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[12138,12,2624,2665,12137],"topic":[],"class_list":["post-6737","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-webappapp","tag-12","tag-2624","tag-app","tag-12137"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6737","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\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=6737"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6737\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=6737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=6737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=6737"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=6737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}