gpt4 book ai didi

ionic2 - ionic : Showing an alert controller with a checkbox and text input

转载 作者:行者123 更新时间:2023-12-04 17:43:40 25 4
gpt4 key购买 nike

我正在尝试显示一个复选框和一个文本输入字段。 ( ionic 3.5.3)

复选框未显示。我看了another SO thread对于类似的问题。代码似乎与我正在做的相同。

编码:

let alert = this.alert.create({
title: 'Name your trip',
inputs: [
{
name: 'name',
placeholder: 'Your trip name',
},
{
name: 'gpsxy',
type:'checkbox',
checked:true,
label:'Log GPS co-ords',
value:"true"
}
],

buttons: [{
text: 'Cancel',
role: 'cancel',
handler: data => {
}
},
{
text: 'Ok',
handler: data => {
}],
});
alert.present();

这是截图: enter image description here

最佳答案

就像您在 the docs 中看到的一样

Alerts can also include several different inputs whose data can be passed back to the app. Inputs can be used as a simple way to prompt users for information. Radios, checkboxes and text inputs are all accepted, but they cannot be mixed. For example, an alert could have all radio button inputs, or all checkbox inputs, but the same alert cannot mix radio and checkbox inputs. Do note however, different types of "text"" inputs can be mixed, such as url, email, text, etc. If you require a complex form UI which doesn't fit within the guidelines of an alert then we recommend building the form within a modal instead.



所以我担心在 Ionic 中不可能做到这一点:(

关于ionic2 - ionic : Showing an alert controller with a checkbox and text input,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45355758/

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