{"id":15669,"date":"2024-01-12T15:43:34","date_gmt":"2024-01-12T07:43:34","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=15669"},"modified":"2024-01-12T15:43:34","modified_gmt":"2024-01-12T07:43:34","slug":"vue-ui%e6%89%93%e5%8c%85dmg%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/15669\/","title":{"rendered":"vue-ui\u6253\u5305dmg\u5982\u4f55\u5b9e\u73b0?"},"content":{"rendered":"

Vue-UI \u662f\u4e00\u4e2a\u57fa\u4e8e Vue.js \u7684 UI \u7ec4\u4ef6\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u8bb8\u591a\u5e38\u7528\u7684 UI \u7ec4\u4ef6\uff0c\u65b9\u4fbf\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efa\u4f18\u79c0\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u5f00winform\u6253\u5305exe<\/a>\u53d1\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06 Vue-UI \u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u7684 dmg \u6587\u4ef6\uff0c\u4ee5\u4fbf\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u5b89\u88c5\u548c\u4f7f\u7528\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u4ecb\u7ecd Vue-UI \u6253\u5305 dmg \u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n

## \u539f\u7406<\/p>\n

\u6253\u5305 dmg \u7684\u539f\u7406\u662f\u5c06 Vue-UI \u5e93\u548c\u76f8\u5173\u8d44\u6e90\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a dmg \u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u53cc\u51fb dmg \u6587\u4ef6\u5b89\u88c5 Vue-UI \u5e93\u3002\u5728 Mac OS X \u4e2d\uff0cdmg \u6587\u4ef6\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u4e2a\u53ef\u6267\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u76f8\u5173\u8d44\u6e90\u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u5c06\u5e94\u7528\u7a0b\u5e8f\u62d6\u62fd\u5230\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u5939\u4e2d\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

## \u6253\u5305\u6b65\u9aa4<\/p>\n

\u4e0b\u9762\u662f\u5c06 Vue-UI \u6253\u5305\u6210 dmg \u6587\u4ef6\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n

### 1. \u5b89\u88c5\u6253\u5305\u5de5\u5177<\/p>\n

\u5728\u5f00\u59cb\u6253\u5305\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e2a\u6253\u5305\u5de5\u5177\uff0c\u6211\u4eec\u9009\u62e9\u4f7f\u7528 electron-builder\uff0c\u5b83\u662f\u4e00\u4e2a\u57fa\u4e8e Electron \u7684\u6253\u5305\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06 Electron \u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u540c\u65f6\u652f\u6301\u591a\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 npm \u5b89\u88c5 electron-builder\uff1a<\/p>\n

“`<\/p>\n

npm install el<\/p>\n

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

ectron-builder –save-dev<\/p>\n

“`<\/p>\n

### 2. \u914d\u7f6e\u6253\u5305\u9009\u9879<\/p>\n

\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a builder.js \u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n

“`javascript<\/p>\n

const builder = require(‘electron-builder’);<\/p>\n

builder.build({<\/p>\n

targets: builder.Platform.MAC.createTarget(),<\/p>\n

config: {<\/p>\n

‘appId’: ‘com.example.vue-ui’,<\/p>\n

‘productName’: ‘Vue-UI’,<\/p>\n

‘artifactName’: ‘vue-ui-${version}.${ext}’,<\/p>\n

‘directories’: {<\/p>\n

‘output’: ‘dist’<\/p>\n

},<\/p>\n

‘dmg’: {<\/p>\n

‘background’: ‘path\/to\/background.png’,<\/p>\n

‘icon’: ‘path\/to\/icon.icns’,<\/p>\n

\u6587\u4ef6\u5939\u6253\u5305exe<\/a>‘contents’: [<\/p>\n

{<\/p>\n

‘x’: 410,<\/p>\n

‘y’: 150,<\/p>\n

‘type’: ‘link’,<\/p>\n

‘path’: ‘\/Applications’<\/p>\n

},<\/p>\n

{<\/p>\n

‘x’: 130,<\/p>\n

‘y’: 150,<\/p>\n

‘type’: ‘file’<\/p>\n

}<\/p>\n

]<\/p>\n

}<\/p>\n

}<\/p>\n

});<\/p>\n

“`<\/p>\n

\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u4e86 builder \u7684 build \u65b9\u6cd5\u6765\u8fdb\u884c\u6253\u5305\u3002\u5176\u4e2d\uff0ctargets \u9009\u9879\u6307\u5b9a\u6211\u4eec\u8981\u6253\u5305\u7684\u5e73\u53f0\uff0c\u8fd9\u91cc\u6211\u4eec\u9009\u62e9\u4e86 Mac OS X\u3002config \u9009\u9879\u662f\u6211\u4eec\u7684\u6253\u5305\u914d\u7f6e\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u4e9b\u57fa\u672c\u4fe1\u606f\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f ID\u3001\u4ea7\u54c1\u540d\u79f0\u3001\u8f93\u51fa\u76ee\u5f55\u7b49\u3002dmg \u9009\u9879\u662f\u6211\u4eec\u7684 dmg \u914d\u7f6e\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u4e9b dmg \u76f8\u5173\u7684\u4fe1\u606f\uff0c\u5982\u80cc\u666f\u56fe\u7247\u3001\u56fe\u6807\u3001\u5b89\u88c5\u4f4d\u7f6e\u7b49\u3002<\/p>\n

### 3. \u6267\u884c\u6253\u5305\u547d\u4ee4<\/p>\n

\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n

“`<\/p>\n

node builder.js<\/p>\n

“`<\/p>\n

\u6253\u5305\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728 dist \u76ee\u5f55\u4e0b\u627e\u5230\u751f\u6210\u7684 dmg \u6587\u4ef6\u3002<\/p>\n

## \u603b\u7ed3<\/p>\n

\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06 Vue-UI \u6253\u5305\u6210\u4e00\u4e2a dmg \u6587\u4ef6\uff0c\u65b9\u4fbf\u7528\u6237\u8fdb\u884c\u5b89\u88c5\u548c\u4f7f\u7528\u3002\u6253\u5305\u5de5\u5177 electron-builder \u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u914d\u7f6e\u9009\u9879\uff0c\u53ef\u4ee5\u6ee1\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002\u5982\u679c\u60a8\u9700\u8981\u5c06 Vue-UI \u6253\u5305\u6210\u5176\u4ed6\u5e73\u53f0\u7684\u5b89\u88c5\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u53c2\u8003 electron-builder \u7684\u6587\u6863\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Vue-UI \u662f\u4e00\u4e2a\u57fa\u4e8e Vue.js \u7684 UI \u7ec4\u4ef6\u5e93\uff0c\u5b83\u63d0\u4f9b\u4e86\u8bb8\u591a\u5e38\u7528\u7684 UI \u7ec4\u4ef6\uff0c\u65b9\u4fbf\u5f00\u53d1\u8005\u5feb\u901f\u6784\u5efa\u4f18\u79c0\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u5f00\u53d1\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u5c06 Vue-UI \u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u7684 dm<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[7612,19416,12,16,801],"topic":[],"class_list":["post-15669","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-htmlexe","tag-exe","tag-12","tag-16","tag-801"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15669","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=15669"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15669\/revisions"}],"predecessor-version":[{"id":15695,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/15669\/revisions\/15695"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=15669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=15669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=15669"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=15669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}