{"id":17528,"date":"2024-01-05T17:50:00","date_gmt":"2024-01-05T09:50:00","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=17528"},"modified":"2024-01-05T17:50:00","modified_gmt":"2024-01-05T09:50:00","slug":"vue%e6%89%93%e5%8c%85%e6%88%90app%e7%9a%84%e5%b7%a5%e5%85%b7%e5%b8%b8%e7%94%a8%e7%9a%84%e6%9c%89%e5%93%aa%e4%ba%9b%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2024\/sjapp\/17528\/","title":{"rendered":"vue\u6253\u5305\u6210app\u7684\u5de5\u5177\u5e38\u7528\u7684\u6709\u54ea\u4e9b\uff1f"},"content":{"rendered":"<p>Vue\u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684JavaScript\u6846\u67b6\uff0c\u4e3b\u8981\u7528\u4e8e\u6784\u5efaWeb\u754c\u9762\u3002\u4f46\u662f\uff0cVue\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Vue\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>Vue\u6253\u5305\u6210app\u7684\u5de5\u5177\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd\uff1aCordova\u548cNativeScript\u3002<\/p>\n<p>Cordova\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528HTML\uff0cCSS\u548cJavaScript\u6784\u5efa\u8de8\u5e73\u53f0\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002Cordova\u63d0\u4f9b\u4e86\u4e00\u4e2aJavaSc<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-2774.html\">pc\u7f51\u7ad9\u6253\u5305<\/a>ript API\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u8bbf\u95ee\u672c\u5730\u8bbe\u5907\u529f\u80fd\uff0c\u5982\u76f8\u673a\uff0cGPS\u548c\u6587\u4ef6\u7cfb\u7edf\u3002Cordova\u4f7f\u7528\u4e00\u4e2a\u79f0\u4e3aWebView\u7684\u672c\u5730\u5bb9\u5668\u6765\u663e\u793a\u5e94\u7528\u7a0b\u5e8f\u7684\u7528\u6237\u754c\u9762\u3002Cordova\u652f\u6301iOS\uff0cAndroid\uff0cWindows\u548cBlackBerry\u7b49\u591a\u4e2a\u5e73\u53f0\u3002<\/p>\n<p>NativeScript\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528JavaScript\uff0cTypeScript\u548cAngular\u6784\u5efa\u8de8\u5e73\u53f0\u79fb\u52a8\u5e94\u7528\u7a0b<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-1076.html\">appandroid\u81ea\u52a8\u6253\u5305<\/a>\u5e8f\u3002NativeScript\u63d0\u4f9b\u4e86\u4e00\u4e2a\u79f0\u4e3aNativeScript Runtime\u7684\u672c\u5730\u5bb9\u5668\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u4f7f\u7528\u672c\u5730UI\u7ec4\u4ef6\u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u7684\u7528\u6237\u754c\u9762\u3002NativeScript\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e2a\u79f0\u4e3aNativeScript Modules\u7684JavaScript API\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u8bbf\u95ee\u672c\u5730\u8bbe\u5907\u529f\u80fd\uff0c\u5982\u76f8\u673a\uff0cGPS\u548c\u6587\u4ef6\u7cfb\u7edf\u3002NativeScript\u652f\u6301iOS\u548cAndroid\u7b49\u591a\u4e2a\u5e73\u53f0\u3002<\/p>\n<p>\u5728\u4f7f\u7528Cordova\u6216NativeScript\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u63d2\u4ef6\u6765\u8bbf\u95ee\u672c\u5730\u8bbe\u5907\u529f\u80fd\u3002\u63d2\u4ef6\u662f\u4e00\u79cd\u7279\u6b8a\u7684JavaScript\u6a21\u5757\uff0c\u5b83\u63d0\u4f9b\u4e86\u8bbf\u95ee\u672c\u5730\u8bbe\u5907\u529f\u80fd\u7684API\u3002\u63d2\u4ef6\u901a\u5e38\u7531\u7b2c\u4e09\u65b9\u5f00\u53d1\u4eba\u5458\u5f00\u53d1\uff0c\u5e76\u901a\u8fc7Cordova\u63d2\u4ef6\u5b58\u50a8\u5e93\u6216NativeScript\u63d2\u4ef6\u5e02\u573a\u8fdb\u884c\u5206\u53d1\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4f7f\u7528Cordova\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5b89\u88c5Cordova<\/p>\n<p>\u8981\u4f7f\u7528Cordova\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u5b83\u3002\u53ef\u4ee5\u4f7f\u7528npm\u8fdb\u884c\u5b89<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/16\/14\/16953839407.jpg\" \/><\/figure>\n<\/p>\n<p>\u88c5\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm install -g cordova<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u521b\u5efaCordova\u9879\u76ee<\/p>\n<p>\u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova create myapp com.example.myapp MyApp<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmyapp\u662f\u9879\u76ee\u7684\u540d\u79f0\uff0ccom.example.myapp\u662f\u9879\u76ee\u7684\u5305\u540d\uff0cMyApp\u662f\u9879\u76ee\u7684\u6807\u9898\u3002<\/p>\n<p>3. \u6dfb\u52a0\u5e73\u53f0<\/p>\n<p>\u6dfb\u52a0\u8981\u6253\u5305\u7684\u5e73\u53f0\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova platform add ios<\/p>\n<p>cordova platform add android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>4. \u5b89\u88c5\u63d2\u4ef6<\/p>\n<p>\u5b89\u88c5\u9700\u8981\u4f7f\u7528\u7684\u63d2\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova plugin add cordova-plugin-camera<\/p>\n<p>cordova plugin add cordova-plugin-geolocation<\/p>\n<p>cordova plugin add cordova-plugin-file<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0ccordova-plugin-camera\u3001cordova-plugin-geolocation\u548ccordova-plugin-file\u662f\u63d2\u4ef6\u7684\u540d\u79f0\u3002<\/p>\n<p>5. \u6784\u5efa\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova build ios<\/p>\n<p>cordova build android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>6. \u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cordova run ios<\/p>\n<p>cordova run android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4f7f\u7528NativeScript\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u7684\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5b89\u88c5NativeScript<\/p>\n<p>\u8981\u4f7f\u7528NativeScript\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5\u5b83\u3002\u53ef\u4ee5\u4f7f\u7528npm\u8fdb\u884c\u5b89\u88c5\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm install -g nativescript<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u521b\u5efaNativeScript\u9879\u76ee<\/p>\n<p>\u521b\u5efa\u4e00\u4e2aNativeScript\u9879\u76ee\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>tns create myapp &#8211;template tns-template-blank-ng<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cmyapp\u662f\u9879\u76ee\u7684\u540d\u79f0\uff0ctns-template-blank-ng\u662f\u9879\u76ee\u7684\u6a21\u677f\u3002<\/p>\n<p>3. \u6dfb\u52a0\u5e73\u53f0<\/p>\n<p>\u6dfb\u52a0\u8981\u6253\u5305\u7684\u5e73\u53f0\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>tns platform add ios<\/p>\n<p>tns platform add android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>4. \u5b89\u88c5\u63d2\u4ef6<\/p>\n<p>\u5b89\u88c5\u9700\u8981\u4f7f\u7528\u7684\u63d2\u4ef6\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>tns plugin add nativescript-camera<\/p>\n<p>tns plugin add nativescript-geolocation<\/p>\n<p>tns plugin add nativescript-file-system<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cnativescript-camera\u3001nativescript-geolocation\u548cnativescript-file-system\u662f\u63d2\u4ef6\u7684\u540d\u79f0\u3002<\/p>\n<p>5. \u6784\u5efa\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>tns build ios<\/p>\n<p>tns build android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>6. \u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>tns run ios<\/p>\n<p>tns run android<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cios\u548candroid\u662f\u5e73\u53f0\u7684\u540d\u79f0\u3002<\/p>\n<p>\u603b\u4f53\u6765\u8bf4\uff0c\u65e0\u8bba\u662f\u4f7f\u7528Cordova\u8fd8\u662fNativeScript\uff0c\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u90fd\u662f\u975e\u5e38\u7b80\u5355\u7684\u3002\u53ea\u9700\u8981\u9075\u5faa\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u5c31\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee5\u4fbf\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vue\u662f\u4e00\u6b3e\u8f7b\u91cf\u7ea7\u7684JavaScript\u6846\u67b6\uff0c\u4e3b\u8981\u7528\u4e8e\u6784\u5efaWeb\u754c\u9762\u3002\u4f46\u662f\uff0cVue\u4e5f\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Vue\u6784\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u6253\u5305\u6210\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u3002Vue\u6253\u5305<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[22371,22370,395,11,226],"topic":[],"class_list":["post-17528","post","type-post","status-publish","format-standard","hentry","category-sjapp","tag-app","tag-ios","tag-395","tag-11","tag-226"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/17528","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=17528"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/17528\/revisions"}],"predecessor-version":[{"id":17578,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/17528\/revisions\/17578"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=17528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=17528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=17528"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=17528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}