Skip to content

Commit ac69ed7

Browse files
committed
优化:纯code插件无需配置html文件
1 parent c13efdc commit ac69ed7

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

electron/mapi/manager/plugin/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export const ManagerPlugin = {
6868
}
6969
// main && mainView
7070
let main = plugin.main || null;
71+
if (!main) {
72+
main = rendererDistPath('static/pluginEmpty.html')
73+
}
7174
let mainView = plugin.mainView || null;
7275
if (!mainView) {
7376
mainView = main

electron/mapi/manager/window/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const ManagerWindow = {
9292
preload,
9393
main,
9494
} = ManagerPlugin.getInfo(plugin)
95-
// console.log('openForCode', {preload, main, height})
95+
// console.log('openForCode', {preload, main})
9696
const viewSession = await ManagerPlugin.getViewSession(plugin)
9797
if (preloadBase) {
9898
viewSession.setPreloads([preloadBase]);

public/static/pluginEmpty.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport"
6+
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Plugin Empty View</title>
9+
</head>
10+
<body>
11+
<div style="text-align:center;padding:5rem 0;color:#999;font-size:2rem;">
12+
Plugin Empty View
13+
</div>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)