提示电子 [英] Prompt on Electron

查看:162
本文介绍了提示电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在电子上替换javascript 提示的功能?

How to replace the function of javascript prompt on electron?

有人可以举个例子吗?

Can someone take me a example?

我尝试使用此函数提示,但发生错误:

I try to use this function prompt, but an error occurs:


未捕获错误:提示符()是,并且不受支持。

Uncaught Error: prompt() is and will not be supported.


推荐答案

提示确认 alert 是阻止脚本执行线程直到用户输入的功能,这是电子团队没有的原因支持它。相反,您可以出于同样的原因使用某些第三方软件包。

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

这篇关于提示电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆