【electron-vue】踩坑笔记1

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chanlingmai5374/article/details/86766010

1、选择文件夹失败。

const {ipcRenderer} = require('electron')
ipcRenderer.send('open-file-dialog')

上面这段代码打不开文件夹。
难道绑定按钮事件不够,需要监听事件才行?

下面这段代码可以打开文件夹。

dialog.showOpenDialog({
                properties: ["openDirectory","openFile"]
            },function (fileNames) {
                // do cool stuff here
            });

等我有时间再测一下。
参考地址:https://stackoverflow.com/questions/44773029

猜你喜欢

转载自blog.csdn.net/chanlingmai5374/article/details/86766010