Skip to content

Commit

Permalink
fix: electron vue template
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgao365 committed Jul 11, 2024
1 parent ed4a046 commit 5615e92
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/electron-react/electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ function createWindow() {
if (isDev) {
win.loadURL(serverUrl);
// Open devTool if the app is not packaged
win.webContents.openDevTools();
setTimeout(() => {
win?.webContents.openDevTools();
}, 500);
} else {
win.loadFile(indexHtml);
}
Expand Down
4 changes: 3 additions & 1 deletion templates/electron-vue/electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ function createWindow() {
if (isDev) {
win.loadURL(serverUrl);
// Open devTool if the app is not packaged
win.webContents.openDevTools();
setTimeout(() => {
win?.webContents.openDevTools();
}, 500);
} else {
win.loadFile(indexHtml);
}
Expand Down
15 changes: 15 additions & 0 deletions templates/electron-vue/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<title>Vite + Electron + Vue + TS</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>

0 comments on commit 5615e92

Please sign in to comment.