【发布时间】:2019-11-08 22:06:56
【问题描述】:
大家晚上好。想问你是否有离子警报单选按钮的处理程序可以自行处理检查,但没有处理程序的按钮。假设我正在检查一个收音机,之后我想执行任何回调,但不是在按钮单击时。有没有办法成功做到这一点?上一小时一直在 github 上挖掘,但一无所获..
import { AllertController } from 'ionic-angular';
...
constructor( public alertController : AlertController ) {}
...
let alertController = this.alertController.create({
title: `Title`,
inputs: [
{
type: 'radio',
label: 'Testlabel',
value: 'Testvalue'
},
{
type: 'radio',
label: 'Testlabel',
value: 'Testvalue'
}
],
buttons: [
{ text: 'Cancel' },
{ text: 'Save' , handler: (data: any) => { // Want to execute that code
on input check , rather than on click on 'Save' button } }
]
});
alertController.present();
如果没有任何与 Alert Controller module 相关的解决方案,我将很高兴收到任何 自定义 解决方案,它们可以重现 AlertController 功能和样式(其他东西而不是 ModalController + ViewController),或者至少会很高兴知道如何使用与 AlertController 相同的样式和行为来表示 ModalController 容器
谢谢大家晚上好!!!
【问题讨论】:
-
检查here。对此有一个功能请求,但链接的评论提供了一种解决方法。
-
我很久以前写的没有按钮的选择stackoverflow.com/questions/40925172/…
标签: cordova ionic-framework ionic2 ionic3 ionic4