Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何强制文件对话框窗口始终在顶部打开,直到用户选择文件或关闭窗口?用户不应该能够导航到应用程序中的其他窗口。
我在文档 https://github.com/electron/electron/blob/master/docs/api/dialog.md#dialogshowopendialogbrowserwindow-options-callback中找到了解决方案
对话框应设置为模态。如果窗口是模态的,它会禁用父窗口。在调用 showSaveDialog 函数时,可以将其设置为模态,将 browserWindow 参数作为第一个参数传递。
例外格式:
dialog.showOpenDialog([browserWindow, ]options[, callback])