electron/docs/fiddles/ipc/pattern-2/renderer.js

8 lines
245 B
JavaScript

const btn = document.getElementById('btn')
const filePathElement = document.getElementById('filePath')
btn.addEventListener('click', async () => {
const filePath = await window.electronAPI.openFile()
filePathElement.innerText = filePath
})