【发布时间】:2020-06-19 09:40:22
【问题描述】:
我正在尝试使用 Electron 的本机对话框支持来打开文件,但我一直遇到这个我似乎无法解决的打字稿问题:
[ts] Type '(folderPath: any) => void' has no properties in common with type 'OpenDialogOptions'.
这是我的代码:
import { ElectronService } from 'ngx-electron'
export class ChartOfAccountsComponent implements OnInit {
public electronDialog = new ElectronService().remote.dialog;
openImport() {
let properties: any = {
title: "Import budget",
properties: ['openDirectory']
}
this.electronDialog.showOpenDialog(properties, (folderPath) => {
if (folderPath === undefined){
console.log("You didn't select a folder");
return;
}
console.log('folderPath', folderPath);
});
}
}
我可以做些什么来解决这个问题吗?
【问题讨论】:
标签: angular typescript electron