shellyln / vue-electron-typescript-quickstart

A boilerplate of Electron app that uses Vue in TypeScript.
30 stars 7 forks source link

Use FS in Vue component #12

Closed Bholtland closed 3 years ago

Bholtland commented 3 years ago

Hi, sorry to post this as an issue, but I'm trying to expose 'fs' module to Vue components, but I can't figure it out. Do you have an idea how to do this with this boilerplate? Thanks for setting it up by the way!

shellyln commented 3 years ago

You can expose Node.js fs module by using "node integration". However, this is too dangerous and not recommended. https://stackoverflow.com/questions/44391448/electron-require-is-not-defined.

You SHOULD use the IPC feature. https://www.electronjs.org/docs/api/context-bridge

Bholtland commented 3 years ago

Thanks, I will look into that!