Giter VIP home page Giter VIP logo

Comments (5)

History-1024 avatar History-1024 commented on June 2, 2024

再补充一下,我在父窗口中可以使用preload定义的window.electronApi。在子窗口中不到

from electron-vite-vue.

RSS1102 avatar RSS1102 commented on June 2, 2024

a.ts

ipcRenderer.send('a-sendMsgMain', msg)

main.ts

ipcMain.on('a-sendMsgMain', (e, msg) => {
	childWin.webContents.send('b-msgFromMain', msg)  // childWin为B窗口
})

b.ts

    ipcRenderer.on('b-msgFromMain', (e, message) => {
        console.log(message)
    });

from electron-vite-vue.

History-1024 avatar History-1024 commented on June 2, 2024

ipcRenderer 我在vue组件引入之后 就会报错,如图报错
image
代码 b.ts
image
代码 main.ts (这里我单独把创建子窗口的方法写在了一个文件中)
image
代码a.ts
image
现在的问题是,为什么引入electron就会有报错出现?

from electron-vite-vue.

History-1024 avatar History-1024 commented on June 2, 2024

https://github.com/History-1024/DEMO-ELECTRON 这个demo

from electron-vite-vue.

RSS1102 avatar RSS1102 commented on June 2, 2024

你找错库了,请查看你的模版来源,看了你的package.json并不是属于这里。

from electron-vite-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.