gpt4 book ai didi

javascript - showMessageBox promise 永远不会被调用

转载 作者:行者123 更新时间:2023-12-03 12:39:56 24 4
gpt4 key购买 nike

消息框显示正确,但是当我选择按钮之一时,关闭不会触发。这是我的代码:

dialog.showMessageBox(options, (response, checkboxChecked) => {
/* More code like log statements, opening error boxes, etc*/
}
选项定义为 choices = ["Yes", "No"], message = "Confirm"
花括号内的代码永远不会运行。

最佳答案

尝试:

 const options = {
type: 'question',
buttons: ['Cancel', 'Yes, please', 'No, thanks'],
defaultId: 2,
title: 'Question',
message: 'Do you want to do this?',
detail: 'It does not really matter',
checkboxLabel: 'Remember my answer',
checkboxChecked: true,
};

dialog.showMessageBox(null, options, (response, checkboxChecked) => {
console.log(response);
console.log(checkboxChecked);
});

关于javascript - showMessageBox promise 永远不会被调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62899221/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com