Electron function to read a local file - FS - Not reading

后端 未结 2 2070
小蘑菇
小蘑菇 2020-12-14 04:50

I have an electron project when I need to get electron to read a local file.

Right now what I have is this, where it loads and displays the contents of a html file.<

2条回答
  •  时光取名叫无心
    2020-12-14 05:07

    Just one update information for the accepted answer. After the update of electron, you can directly use

    const { dialog } = require('electron');
    

    to import dialog.

    And for remote, if you need to use it, you also need:

    const { remote } = require('electron');
    

提交回复
热议问题