\u82f9\u679capp\u6253\u5305\u5546\u57ce\u8fc7\u5ba1<\/a> npm install -g react-native-cli<\/p>\n “`<\/p>\n
2. \u521b\u5efa\u4e00\u4e2a\u65b0\u7684Cordova\u6216React Native\u9879\u76ee:<\/p>\n
– \u4f7f\u7528Cordova\u521b\u5efa\u9879\u76ee\u7684\u547d\u4ee4\u5982\u4e0b:<\/p>\n
“`<\/p>\n
cordova create <\/p>\n
“`<\/p>\n
– \u4f7f\u7528React Native\u521b\u5efa\u9879\u76ee\u7684\u547d\u4ee4\u5982\u4e0b:<\/p>\n
“`<\/p>\n
react-native init <\/p>\n
“`<\/p>\n
3. \u5c06Vue\u5e94\u7528\u7684\u4ee3\u7801\u590d\u5236\u5230\u521b\u5efa\u7684Cordova\u6216React Native\u9879\u76ee\u4e2d\u3002<\/p>\n
4. \u5728Cordova\u6216React Native\u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u76f8\u5173\u914d\u7f6e:<\/p>\n
– Cordova\u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a`config.xml`\uff0c\u4f60\u9700\u8981\u6dfb\u52a0\u4e00\u4e2a“\u6807\u7b7e\uff0c\u5f15\u7528Vue\u5e94\u7528\u7684\u5165\u53e3\u6587\u4ef6\u3002<\/p>\n
– React Native\u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\u4e3a`package.json`\uff0c\u4f60\u9700\u8981\u7f16\u8f91\u5176\u4e2d\u7684`main`\u5b57\u6bb5\uff0c\u6307\u5b9aVue\u5e94\u7528\u7684\u5165\u53e3\u6587\u4ef6\u3002<\/p>\n
5. \u6784\u5efa\u548c\u7f16\u8bd1App:<\/p>\n
– \u4f7f\u7528Cordova\u6784\u5efaApp\u7684\u547d\u4ee4\u5982\u4e0b:<\/p>\n
“`<\/p>\n
cordova build <\/p>\n
“`<\/p>\n
– \u4f7f\u7528React Native\u6784\u5efaApp\u7684\u547d\u4ee4\u5982\u4e0b:<\/p>\n
“`<\/p>\n
react-native run-ios<\/p>\n
“`<\/p>\n
6. \u5728\u6a21\u62df\u5668\u6216\u771f\u673a\u4e0a\u8fd0\u884cApp:<\/p>\n
– \u5bf9\u4e8eCordova\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cApp:<\/p>\n
“`<\/p>\n
cordova run <\/p>\n
“`<\/p>\n
– \u5bf9\u4e8eReact Native\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cApp:<\/p>\n
“`<\/p>\n
react-native run-ios<\/p>\n
“`<\/p>\n
\u6ce8\u610f: \u5728\u8fd0\u884cReact Native\u9879\u76ee\u65f6\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u5df2\u7ecf\u542f\u52a8\u4e86\u6a21\u62df\u5668\u6216\u5df2\u7ecf\u8fde\u63a5\u4e86\u771f\u673a\u3002<\/p>\n
\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u6253\u5305\u6210App\u9002\u7528\u4e8e\u82f9\u679c\u8bbe\u5907\u3002\u5f53\u7136\uff0c\u8fd8\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u7684\u9700\u6c42\u8fdb\u884c\u66f4\u591a\u7684\u5b9a\u5236\u548c\u914d\u7f6e\uff0c\u6bd4\u5982\u6dfb\u52a0\u63d2\u4ef6\u3001\u8bbe\u7f6e\u6743\u9650\u7b49\u7b49\u3002<\/p>\n
\u603b\u7ed3:<\/p>\n
\u672c\u6587\u4ecb\u7ecd\u4e86Vue\u6253\u5305App\u9002\u7528\u4e8e\u82f9\u679c\u8bbe\u5907\u7684\u57fa\u672c\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002\u901a\u8fc7\u4f7f\u7528Cordova\u6216React Native\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u8f6c\u5316\u4e3a\u539f\u751fApp\uff0c\u5e76\u5728\u82f9\u679c\u8bbe\u5907\u4e0a\u8fdb\u884c\u90e8\u7f72\u548c\u8fd0\u884c\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"
\u5f53\u6211\u4eec\u4f7f\u7528Vue\u5f00\u53d1Web\u5e94\u7528\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7Vue CLI\u8fdb\u884c\u9879\u76ee\u6253\u5305\uff0c\u751f\u6210\u53ef\u90e8\u7f72\u7684\u9759\u6001\u6587\u4ef6\u3002\u4f46\u662f\uff0c\u5982\u679c\u6211\u4eec\u5e0c\u671b\u5c06Vue\u5e94\u7528\u6253\u5305\u6210App\u9002\u7528\u4e8e\u82f9\u679c\u8bbe\u5907\uff0c\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u989d\u5916\u7684\u5de5\u4f5c\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[47,832,2205,1571,23],"topic":[],"class_list":["post-9241","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-vueapp","tag-832","tag-app","tag-1571","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9241","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=9241"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9241\/revisions"}],"predecessor-version":[{"id":9348,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9241\/revisions\/9348"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=9241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=9241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=9241"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=9241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}