The usual, the first to spit groove, and then record.
I was educated by my boss for nearly one hours today. Because of the previously automatic update of the module, I think has been completed, but there are some details are not perfect, has been education ~
All things done, after submission close issue!
In electron, the JS file loaded from Package.json Main is the main process, and the page that is load by the main process is the rendering process.
The rendering process can have multiple, and the main process has only one "main.js".
Communication between the main process and the rendering process can be communicated using Ipcmain (master process) and Ipcrenderer (render process), or by using remote modules.
The IPC module is not introduced, nothing more than a send ' ipcxx.send (channel, Arg) ', then a Receive ' Ipcoo.on (channel, function.) '.
Can be sent and received multiple times, but the ipcxx must be different to communicate with each other, using the channel's information name to identify.
The use of remote was just learned today. There are several sub-modules under remote, such as the app module.
Use ' app.xxx = [Some instance class A, B, C] ' in the main process, because instances of some classes can only be performed once (such as the default set of reads, and so on, will cause the file to become chaotic),
So we can use REMOTE.APP.XXX.A in the rendering process to use classes and methods that are instantiated in the main process.
Say one more. In the main process is often to introduce some additional JS files, in those additional JS files using Main.js declared variables, because it is not a JS file, it needs to be global, so that it can be used in other "direct" files.
All Thanks
The main process and rendering process differences and communication in 17-7-20-electron