Comments (5)
再补充一下,我在父窗口中可以使用preload定义的window.electronApi。在子窗口中不到
from electron-vite-vue.
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.
ipcRenderer 我在vue组件引入之后 就会报错,如图报错
代码 b.ts
代码 main.ts (这里我单独把创建子窗口的方法写在了一个文件中)
代码a.ts
现在的问题是,为什么引入electron就会有报错出现?
from electron-vite-vue.
https://github.com/History-1024/DEMO-ELECTRON 这个demo
from electron-vite-vue.
你找错库了,请查看你的模版来源,看了你的package.json并不是属于这里。
from electron-vite-vue.
Related Issues (20)
- How to pack? HOT 3
- how is work HOT 2
- [Help] mysql2这个npm包无法被排除构建 HOT 4
- [Help] 希望加个eslint。谢谢 HOT 1
- [Bug] 修改renderer代码后,保存,F5可能没生效,关闭程序再次F5就好了
- [Help]如何打开一个新窗口并且使用vue-router跳转 HOT 2
- printWindow.webContents.print({ silent: true })[Help] the title of help wanted report HOT 1
- 有交流群吗或者有官网吗? HOT 1
- [Bug] Missing return statement in invoke method of preload script in Electron template HOT 1
- vite配置了base参数后,build之后找不到js文件 HOT 5
- [Bug] electron降级到22版本提示不支持require() of ES Module HOT 5
- 想要发布用户 客户在线热更新功能 HOT 1
- Can not build success cause of icon set HOT 10
- [Help] 如何在 Vue 组件中使用fs模块? HOT 11
- [Bug] node-22无法调试
- pnpm build后进度一直不动 HOT 2
- 打包得时候遇到个问题,不知道是什么原因引起的 HOT 2
- [Help] the title of help wanted report
- [Help] the title of help wanted report HOT 1
- [Help] 如何实现Bytecode的加固,需要一个开箱即用的插件
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-vite-vue.