【发布时间】:2020-05-11 07:23:00
【问题描述】:
有没有办法在 Angular/Electron 应用程序中创建无模式对话框?
我正在查看下面的示例,它们都是模态的:
https://material.angular.io/components/dialog/overview
我需要能够同时打开多个窗口并四处移动它们。但我找不到任何样本。
谢谢。
编辑 1:
我尝试了以下方法,但不知何故将我引导至默认页面 index.html:
window.open('/app/shared/settings/user-preferences.html');
编辑 2:
我也尝试了以下方法,但无法编译。
const { BrowserWindow } = require('electron'); //does not compile!!?
let win = new BrowserWindow({ width: 800, height: 600 });
win.on('closed', () => {
win = null;
});
win.loadURL(`file://${__dirname}/app/shared/settings/user-preferences.html`);
但这不会编译并给我错误消息:
ERROR in ./node_modules/electron/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\projects\...\MyApp\node_modules\electron'
ERROR in ./node_modules/electron/index.js
Module not found: Error: Can't resolve 'path' in 'C:\projects\...\MyApp\node_modules\electron'
【问题讨论】:
-
嗨,你的意思是 window.open() 之类的?就像在带有对话框上下文的实际新窗口中一样...
-
感谢您的回复。 window.open() 可能会。我已经尝试过了,但它以某种方式导致 Index.html。我是否正确使用它? window.open('/app/shared/settings/user-preferences.html');
-
检查帖子是否是您要查找的内容
标签: angular angular-material dialog electron modeless-dialog