{"id":18626,"date":"2024-01-16T15:43:22","date_gmt":"2024-01-16T07:43:22","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=18626"},"modified":"2024-01-16T15:43:22","modified_gmt":"2024-01-16T07:43:22","slug":"vue%e6%89%93%e5%8c%85%e6%88%90%e5%8f%af%e4%bb%a5%e7%9b%b4%e6%8e%a5%e8%bf%90%e8%a1%8c%e7%9a%84exe%e5%a6%82%e4%bd%95%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2024\/ruanjiankf\/18626\/","title":{"rendered":"vue\u6253\u5305\u6210\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u7684exe\u5982\u4f55\u64cd\u4f5c"},"content":{"rendered":"<p><a href=\"https:\/\/exe.yimenapp.com\/tool-1439.html\">\u82f9\u679c\u7535\u8111\u7528exe\u8f6f\u4ef6<\/a>  <\/p>\n<p>Vue\u662f\u4e00\u4e2a\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u73b0\u4ee3\u5355\u9875\u9762\u5e94\u7528\u7a0b\u5e8f\uff08SPA\uff09\u3002Vue\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728Web\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Electron\u5c06\u5176\u6253\u5305\u6210\u53ef\u5728\u684c\u9762\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Electron\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff08exe\uff09\u3002<\/p>\n<p>Electron\u662f\u4e00\u4e2a\u5f00\u6e90\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u8de8\u5e73\u53f0\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u57fa\u4e8eNode.js\u548cChromium\uff0c\u5141\u8bb8\u4f7f\u7528Web\u6280\u672f\uff08HTML\uff0cCSS\u548cJavaScript\uff09\u6784\u5efa\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002Electron\u63d0\u4f9b\u4e86\u4e00\u4e2a\u540d\u4e3aElectron Builder\u7684\u63d2\u4ef6\uff0c\u5b83\u53ef\u4ee5\u5c06Electron\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u5728Windows\uff0cmacOS\u548cLinux\u4e0a\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u4e0b\u9762\u662f\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5b89\u88c5Electron\u548cElectron Builder<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d<a href=\"https:\/\/exe.yimenapp.com\/tool-2902.html\">pc\u5ba2\u6237\u7aef\u5f00\u53d1\u8f6f\u4ef6<\/a>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Electron\u548cElectron Builder\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm install &#8211;save-dev electron electron-builder<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u914d\u7f6epackage.json<\/p>\n<p>\u5728package.json\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>&#8220;build&#8221;: {<\/p>\n<p>  &#8220;productName&#8221;: &#8220;My App&#8221;,<\/p>\n<p>  &#8220;appId&#8221;: &#8220;com.myapp&#8221;,<\/p>\n<p>  &#8220;directories&#8221;: {<\/p>\n<p>    &#8220;output&#8221;: &#8220;dist&#8221;<\/p>\n<p>  },<\/p>\n<p>  &#8220;files&#8221;: [<\/p>\n<p>    &#8220;dist\/**\/*&#8221;,<\/p>\n<p>    &#8220;node_modules\/**\/*&#8221;<\/p>\n<p>  ],<\/p>\n<p>  &#8220;win&#8221;: {<\/p>\n<p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/17\/16\/30514723691.jpg\" \/><\/figure>\n<\/p>\n<p>&#8220;target&#8221;: &#8220;nsis&#8221;<\/p>\n<p>  }<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u4e9b\u914d\u7f6e\u6307\u5b9a\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\uff0cID\uff0c\u8f93\u51fa\u76ee\u5f55\uff0c\u8981\u5305\u542b\u7684\u6587\u4ef6\u4ee5\u53ca\u8981\u6784\u5efa\u7684Windows\u76ee\u6807\uff08nsis\u8868\u793a\u4f7f\u7528Nullsoft Scriptable Install System\u6784\u5efa\u5b89\u88c5\u7a0b\u5e8f\uff09\u3002<\/p>\n<p>3. \u6784\u5efaVue\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6784\u5efaVue\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm run build<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u5728dist\u76ee\u5f55\u4e2d\u751f\u6210\u7f16\u8bd1\u540e\u7684Vue\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>4. \u6253\u5305Electron\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6253\u5305Electron\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>npm run electron:build<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u4f7f\u7528Electron Builder\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u548cElectron\u6846\u67b6\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002\u6253\u5305\u5b8c\u6210\u540e\uff0c\u53ef\u6267\u884c\u6587\u4ef6\u5c06\u4f4d\u4e8edist\u76ee\u5f55\u4e2d\u7684win-unpacked\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p>5. \u5b89\u88c5\u548c\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5728dist\u76ee\u5f55\u4e2d\uff0c\u53cc\u51fb\u53ef\u6267\u884c\u6587\u4ef6\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u8be5\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002\u4f7f\u7528\u7c7b\u4f3c\u7684\u6b65\u9aa4\uff0c\u4e5f\u53ef\u4ee5\u5c06Vue\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u5728macOS\u548cLinux\u4e0a\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vue\u662f\u4e00\u4e2a\u6d41\u884c\u7684JavaScript\u6846\u67b6\uff0c\u7528\u4e8e\u6784\u5efa\u73b0\u4ee3\u5355\u9875\u9762\u5e94\u7528\u7a0b\u5e8f\uff08SPA\uff09\u3002Vue\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728Web\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Electron\u5c06\u5176\u6253\u5305\u6210\u53ef\u5728\u684c\u9762\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c06<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1191,22961,407,22962,11],"topic":[],"class_list":["post-18626","post","type-post","status-publish","format-standard","hentry","category-ruanjiankf","tag-1191","tag-22961","tag-407","tag-dmg","tag-11"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/18626","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\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=18626"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/18626\/revisions"}],"predecessor-version":[{"id":18628,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/18626\/revisions\/18628"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=18626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=18626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=18626"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=18626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}