看不懂的UBT
看不懂的UBT
  • 发布:2024-05-04 12:35
  • 更新:2024-05-04 12:35
  • 阅读:45

开发electron桌面应用,两个窗口 怎么弄

分类:uni-app

两个问题:

  1. uniapp 想开发桌面端,登录窗口和内容窗口分开,就是 登录后打开另一个窗口,这个该怎么弄。
    electron 代码:

    const createWindow = () => {  
    const win1 = new BrowserWindow({  
    width: 800,  
    height: 800,  
    })  
    win1.loadFile('unpackage/dist/build/h5/index.html') // 登录后,就直接跳转了。  
    
    const win2 = new BrowserWindow({  
    width: 800,  
    height: 800,  
    })  
    win2.loadFile(‘这个地方路径要怎么写。’)  
    }
  2. 渲染进程中:

    import {  
        ipcRenderer  
    } from 'electron'  
    const switchToSecondWindow = () => {  
        ipcRenderer.send('switch-window');  
    }

    这段代码,报错:__dirname is not defined
    这个该怎么解决?

哪位大神 帮忙解决一下,谢谢啊

2024-05-04 12:35 负责人:无 分享
已邀请:

要回复问题请先登录注册