gpt4 book ai didi

javascript - cordovaDialogs没有返回值

转载 作者:行者123 更新时间:2023-11-28 05:26:41 24 4
gpt4 key购买 nike

我正在尝试运行其中一个

$cordovaDialogs.confirm('message', 'title', ['button 1','button 2'])
.then(function(buttonIndex) {

 $cordovaDialogs.prompt('msg', 'title', ['btn 1','btn 2'], 'default text')
.then(function(result) {
var input = result.input1;

如所列here ,但对于这两种情况,then 回调中的返回值都是未定义。这里有什么想法/修复吗?

最佳答案

我知道您正在尝试使用$cordovaDialogs,但也许可以尝试一下$ionicPopup?我对这个插件的运气更好。其工作原理基本相同。

$ionicPopup.confirm({
title: 'Consume Ice Cream',
template: 'Are you sure you want to eat this ice cream?'
}).then(function(res) {
if(res) {
console.log('You are sure');
} else {
console.log('You are not sure');
}
});

这是它的文档:https://ionicframework.com/docs/api/service/ $ionicPopup/

如果您仍然无法正常工作,请发表评论,我们会解决问题。这两个插件我都用过,我更喜欢 ionic-popup。

关于javascript - cordovaDialogs没有返回值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40090811/

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