{"id":15829,"date":"2024-01-16T15:43:28","date_gmt":"2024-01-16T07:43:28","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=15829"},"modified":"2024-01-16T15:43:28","modified_gmt":"2024-01-16T07:43:28","slug":"vue%e6%89%93%e5%8c%85exe%e5%b7%a5%e5%85%b7%e5%b8%b8%e7%94%a8%e7%9a%84%e6%8e%a8%e8%8d%90","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/15829\/","title":{"rendered":"vue\u6253\u5305exe\u5de5\u5177\u5e38\u7528\u7684\u63a8\u8350"},"content":{"rendered":"

Vue.js\u662f\u4e00\u79cd\u6d41\u884c\u7684JavaScript\u6846\u591a\u4e2a\u6587\u4ef6\u6253\u5305\u4e3a1\u4e2aexe<\/a>\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u5355\u9875Web\u5e94\u7528\u7a0b\u5e8f\u3002Vue.js\u5177\u6709\u6613\u4e8e\u5b66\u4e60\u7684API\u548c\u7075\u6d3b\u7684\u7ec4\u4ef6\u7cfb\u7edf\uff0c\u4f7f\u5176\u6210\u4e3a\u5f00\u53d1\u4eba\u5458\u7684\u9996\u9009\u6846\u67b6\u4e4b\u4e00\u3002\u7136\u800c\uff0c\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u80fd\u662f\u4e00\u4e2a\u6311\u6218\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u4e00\u4e9bVue.js\u6253\u5305\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u539f\u7406\u3002<\/p>\n

1. Electron<\/p>\n

Electron\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u6846\u67b6\uff0c\u7528\u4e8e\u5c06Web\u6280\u672f\u6253\u5305\u4e3a\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u662f\u7531GitHub\u5f00\u53d1\u7684\uff0c\u88ab\u7528\u4e8e\u6784\u5efa\u8bb8\u591a\u6d41\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5982Visual Studio Code\u548cGitHub Desktop\u3002Electron\u4f7f\u7528Chromium\u4f5c\u4e3aWeb\u6e32\u67d3\u5f15\u64ce\uff0c\u53ef\u4ee5\u4f7f\u7528Node.js\u8bbf\u95ee\u64cd\u4f5c\u7cfb\u7edf\u7684API\u3002<\/p>\n

Electron\u7684\u5de5\u4f5c\u539f\u7406\u662f\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aElectron\u7684\u4e3b\u8fdb\u7a0b\u548c\u6e32\u67d3\u8fdb\u7a0b\u3002\u4e3b\u8fdb\u7a0b\u662f\u4e00\u4e2aNode.js\u8fdb<\/p>\n

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

\u7a0b\uff0c\u8d1f\u8d23\u5e94\u7528\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u548c\u64cd\u4f5c\u7cfb\u7edf\u4ea4\u4e92\u3002\u6e32\u67d3\u8fdb\u7a0b\u662f\u4e00\u4e2aChromium\u8fdb\u7a0b\uff0c\u8d1f\u8d23\u6e32\u67d3Vue.js\u5e94\u7528\u7a0b\u5e8f\u7684UI\u3002Vue.js\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u901a\u8fc7Electron\u7684IPC\u673a\u5236\u4e0e\u4e3b\u8fdb\u7a0b\u901a\u4fe1\u3002<\/p>\n

2. NW.js<\/p>\n

NW.js\u662f\u53e6\u4e00\u4e2a\u5c06Web\u6280\u672f\u6253\u5305\u4e3a\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u7684\u6846\u67b6\u3002\u5b83\u4e0eElectron\u7c7b\u4f3c\uff0c\u4f46\u4f7f\u7528\u4e86\u4e0d\u540c\u7684Web\u5982\u4f55\u518d\u6b21\u5c01\u88c5\u8f6f\u4ef6<\/a>\u6e32\u67d3\u5f15\u64ce\uff08WebKit\u6216Chromium\uff09\u548cNode.js\u7684\u7248\u672c\u3002NW.js\u4e5f\u63d0\u4f9b\u4e86\u8bbf\u95ee\u64cd\u4f5c\u7cfb\u7edfAPI\u7684\u80fd\u529b\u3002<\/p>\n

NW.js\u7684\u5de5\u4f5c\u539f\u7406\u4e0eElectron\u76f8\u4f3c\uff0c\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aNW.js\u7684\u4e3b\u8fdb\u7a0b\u548c\u6e32\u67d3\u8fdb\u7a0b\u3002\u4e3b\u8fdb\u7a0b\u662f\u4e00\u4e2aNode.js\u8fdb\u7a0b\uff0c\u8d1f\u8d23\u5e94\u7528\u7a0b\u5e8f\u7684\u751f\u547d\u5468\u671f\u548c\u64cd\u4f5c\u7cfb\u7edf\u4ea4\u4e92\u3002\u6e32\u67d3\u8fdb\u7a0b\u662f\u4e00\u4e2aWebkit\u6216Chromium\u8fdb\u7a0b\uff0c\u8d1f\u8d23\u6e32\u67d3Vue.js\u5e94\u7528\u7a0b\u5e8f\u7684UI\u3002Vue.js\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u901a\u8fc7NW.js\u7684IPC\u673a\u5236\u4e0e\u4e3b\u8fdb\u7a0b\u901a\u4fe1\u3002<\/p>\n

3. Nativefier<\/p>\n

Nativefier\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06\u4efb\u4f55Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u4f7f\u7528Electron\u4f5c\u4e3a\u5e95\u5c42\u6846\u67b6\uff0c\u4f46\u4e0d\u9700\u8981\u7f16\u5199\u4efb\u4f55\u4ee3\u7801\u3002Nativefier\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aElectron\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u9009\u9879\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3001\u56fe\u6807\u548c\u7a97\u53e3\u5927\u5c0f\u3002<\/p>\n

Nativefier\u7684\u5de5\u4f5c\u539f\u7406\u662f\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aElectron\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u4f7f\u7528Electron\u7684API\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002Nativefier\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u9009\u9879\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3001\u56fe\u6807\u548c\u7a97\u53e3\u5927\u5c0f\u3002<\/p>\n

4. Vue CLI Plugin Electron Builder<\/p>\n

Vue CLI Plugin Electron Builder\u662f\u4e00\u4e2aVue CLI\u63d2\u4ef6\uff0c\u7528\u4e8e\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aElectron\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u4f7f\u7528Electron Builder\u4f5c\u4e3a\u5e95\u5c42\u6253\u5305\u5de5\u5177\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u9009\u9879\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3001\u56fe\u6807\u548c\u7a97\u53e3\u5927\u5c0f\u3002<\/p>\n

Vue CLI Plugin Electron Builder\u7684\u5de5\u4f5c\u539f\u7406\u662f\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3aElectron\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u4f7f\u7528Electron Builder\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002Vue CLI Plugin Electron Builder\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u81ea\u5b9a\u4e49\u9009\u9879\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u3001\u56fe\u6807\u548c\u7a97\u53e3\u5927\u5c0f\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

\u4ee5\u4e0a\u662f\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u4e00\u4e9b\u65b9\u6cd5\u548c\u539f\u7406\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u70b9\u548c\u7f3a\u70b9\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u65b9\u6cd5\u3002\u65e0\u8bba\u60a8\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u6253\u5305Vue.js\u5e94\u7528\u7a0b\u5e8f\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u90fd\u662f\u53ef\u884c\u7684\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u6362\u4e3a\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Vue.js\u662f\u4e00\u79cd\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u5355\u9875Web\u5e94\u7528\u7a0b\u5e8f\u3002Vue.js\u5177\u6709\u6613\u4e8e\u5b66\u4e60\u7684API\u548c\u7075\u6d3b\u7684\u7ec4\u4ef6\u7cfb\u7edf\uff0c\u4f7f\u5176\u6210\u4e3a\u5f00\u53d1\u4eba\u5458\u7684\u9996\u9009\u6846\u67b6\u4e4b\u4e00\u3002\u7136\u800c\uff0c\u5c06Vue.js\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u53ef\u6267<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[19493,252,12,25,249],"topic":[],"class_list":["post-15829","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-gulpdmg","tag-web","tag-12","tag-25","tag-249"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15829","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\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=15829"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15829\/revisions"}],"predecessor-version":[{"id":15855,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15829\/revisions\/15855"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=15829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=15829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=15829"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=15829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}