Replace 'Prompt' in on Electron

前端 未结 2 692
梦如初夏
梦如初夏 2020-12-10 01:53

How to replace the function of javascript prompt in electron?

Can someone give me an example?

I tried to use the function prompt,

2条回答
  •  一生所求
    2020-12-10 02:21

    prompt, confirm and alert are functions which blocks the execution thread of the script until a user input and that's the reason electron team didn't supported it. Instead you can use some third party package for the same reason.

    Here are some packages which provides this functionality in async way

    https://www.npmjs.com/package/smalltalk

    https://www.npmjs.com/package/vex-js

    https://www.npmjs.com/package/dialogs

提交回复
热议问题