为 Windows 平台添加沉浸式标题栏 (#277)

This commit is contained in:
Mr. Will 2021-02-12 12:03:01 +00:00 committed by GitHub
parent c0c4597cd8
commit 51fc57efe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 147 additions and 2 deletions

View file

@ -2,6 +2,10 @@ export function ipcRenderer(vueInstance) {
const self = vueInstance;
// 添加专有的类名
document.body.setAttribute("data-electron", "yes");
document.body.setAttribute(
"data-electron-platform-win32",
window.require("os").platform() == "win32" ? "yes" : "no"
);
// ipc message channel
const electron = window.require("electron");
const ipcRenderer = electron.ipcRenderer;