umbrella22 / electron-vite-template

This project is a vue3 + Vite + electron project template composed of Vite and rollup. It has the same functions as my previous electron+Vue+template project
Other
393 stars 107 forks source link

通过A链接或是window.open()创建的窗口,父子间如何通信? #109

Open tom-style opened 11 months ago

tom-style commented 11 months ago

在浏览器上在子窗口用 window.opener 可以访问到父窗口对象,在electron里面要如何操作?

umbrella22 commented 11 months ago

并不建议在electron中使用a标签或者是open方法打开新的窗口,您可以转用ipc的形式去创建窗口实例,并通过窗口id进行通讯