mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 19:52:10 +08:00
window
This commit is contained in:
@@ -182,6 +182,28 @@ class ExampleController extends Controller {
|
||||
this.app.electron.mainWindow.removeBrowserView(browserViewObj);
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开新窗口
|
||||
*/
|
||||
createWindow (args) {
|
||||
let content = null;
|
||||
if (args.type == 'html') {
|
||||
content = path.join('file://', electronApp.getAppPath(), args.content)
|
||||
} else {
|
||||
content = args.content;
|
||||
}
|
||||
|
||||
let winObj = new BrowserWindow({
|
||||
x: 10,
|
||||
y: 10,
|
||||
width: 980,
|
||||
height: 650
|
||||
})
|
||||
winObj.loadURL(content);
|
||||
|
||||
return winObj.id
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = ExampleController;
|
||||
|
||||
Reference in New Issue
Block a user