[TOC] [https://electronjs.org/docs/api/dialog](https://electronjs.org/docs/api/dialog) ## 常用接口 * dialog.showOpenDialog 打开对话框 * dialog.showSaveDialog 保存对话框 * dialog.showMessageBox 消息对话框 * dialog.showErrorBox 错误对话框 ## 案例 ### 文件选择框 ``` const {dialog} =require('electron').remote; dialog.showOpenDialog({ title:'测试标题 title', defaultPath :'D:',//选择打开路径 properties: ['openFile',],//openFile=只显示文件 openDirectory=只显示路径 }, (files) => { // files 文件路径数组 }) ```