Fetch the repository succeeded.
This action will force synchronization from Sky/electron-vue-template, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
config
文件,转而使用 env 文件夹中的 .env
在改文件内的所有内容均会注入到 process.env.userConfig
主进程和渲染进程同名i18n
新增对 element-ui
的支持为保证
element-ui
正确国际化,请确保src/renderer/i18n/languages
文件夹下的语言包名与element-ui
的语言包名一致
i18n
支持语言包存放在 src/renderer/i18n/languages
文件夹下,每种语言一个文件,新增语言包也无需手动引入
node .electron-vue/build.js
前添加cross-env TERGET_ENV=test
,即可启用,相应的您应当在config文件夹以及其index.js
文件中按照development
对象写好相同的代码方可在主/渲染进程中使用process.env.TERGET_ENV
来取得您的设置项。ELECTRON_MIRROR
,变量值为https://npm.taobao.org/mirrors/electron/
,另一个是变量名为registry
,变量值为https://registry.npm.taobao.org/
,然后系统变量中同样也加上这两个值,完成之后,删除 node_module 文件夹。然后执行 yarn install,如果还是提示未安装,那就去 electron 文件夹内执行一次 yarn install,就好了。这样的话,不仅仅只是 yarn 更快了,electron 的 rebuild 也会加速很多。所以推荐使用 yarn。 "dependencies": {
"@types/node": "^12.0.12",
"extract-zip": "^1.0.3",
"electron-download": "^4.1.0"
},
#!/usr/bin/env node
var version = require("./package").version;
var fs = require("fs");
var os = require("os");
var path = require("path");
var extract = require("extract-zip");
var download = require("electron-download");
var installedVersion = null;
try {
installedVersion = fs
.readFileSync(path.join(__dirname, "dist", "version"), "utf-8")
.replace(/^v/, "");
} catch (ignored) {
// do nothing
}
if (process.env.ELECTRON_SKIP_BINARY_DOWNLOAD) {
process.exit(0);
}
var platformPath = getPlatformPath();
var electronPath =
process.env.ELECTRON_OVERRIDE_DIST_PATH ||
path.join(__dirname, "dist", platformPath);
if (installedVersion === version && fs.existsSync(electronPath)) {
process.exit(0);
}
// downloads if not cached
download(
{
cache: process.env.electron_config_cache,
version: version,
platform: process.env.npm_config_platform,
arch: process.env.npm_config_arch,
strictSSL: process.env.npm_config_strict_ssl === "true",
force: process.env.force_no_cache === "true",
quiet: process.env.npm_config_loglevel === "silent" || process.env.CI,
},
extractFile
);
// unzips and makes path.txt point at the correct executable
function extractFile(err, zipPath) {
if (err) return onerror(err);
extract(zipPath, { dir: path.join(__dirname, "dist") }, function (err) {
if (err) return onerror(err);
fs.writeFile(
path.join(__dirname, "path.txt"),
platformPath,
function (err) {
if (err) return onerror(err);
}
);
});
}
function onerror(err) {
throw err;
}
function getPlatformPath() {
var platform = process.env.npm_config_platform || os.platform();
switch (platform) {
case "darwin":
return "Electron.app/Contents/MacOS/Electron";
case "freebsd":
case "linux":
return "electron";
case "win32":
return "electron.exe";
default:
throw new Error(
"Electron builds are not available on platform: " + platform
);
}
}
npm run update:serve
来启动这个 node 服务器,然后您如果想在 dev 的时候就看到效果需要先运行 build 拿到 latest.yml
文件,然后将其更名为 dev-app-update.yml
放入dist/electron
中,和main.js
同级,然后你需要关闭或者排除 webpack 的自动清除插件(我已经屏蔽了,所以无需大家自己动手),然后点击软件中的检查更新即可,记住当软件正在运行的时候,是无法应用安装的,所以您需要关闭之后方可安装。这并不是一个错误!此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。