mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-29 22:39:45 +08:00
feat: 支持openDialog api
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {app, BrowserWindow} from 'electron';
|
||||
import {app, BrowserWindow, dialog} from 'electron';
|
||||
import {getlocalDataFile, saveData, getData} from './utils';
|
||||
import path from "path";
|
||||
|
||||
@@ -25,6 +25,9 @@ export default {
|
||||
showMainWindow(arg, mainWindow) {
|
||||
mainWindow.show();
|
||||
},
|
||||
showOpenDialog({options}) {
|
||||
return JSON.parse(JSON.stringify(dialog.showOpenDialogSync(options)));
|
||||
},
|
||||
onPluginEnter(arg) {
|
||||
return arg
|
||||
},
|
||||
|
||||
@@ -63,7 +63,7 @@ export default function init(mainWindow) {
|
||||
fn = fn[op];
|
||||
});
|
||||
const data = await fn(arg, window);
|
||||
window.webContents.send(`msg-back-${arg.type}`, data);
|
||||
event.sender.send(`msg-back-${arg.type}`, data);
|
||||
});
|
||||
|
||||
ipcMain.on('new-window', (event, arg) => {
|
||||
|
||||
Reference in New Issue
Block a user