【发布时间】:2022-11-07 12:58:35
【问题描述】:
我正在尝试从 Ionic 框架应用程序中的警报中获取价值。我做了应用程序,当我单击按钮时,会出现我可以输入字符串的警报(提示)。即使我在输入框中输入字符串并按“确定”按钮,我也无能为力。我想获取每个输入框的字符串数据。
我应该怎么办?基本语言是 JavaScript。 (angularjs, javascript, .ts 文件) 我正在尝试将 WIFI 信息放入输入框中并想要处理它。例如,如果我输入“test”并按“ok”,我想将它保存在变量中。请帮忙。肿瘤坏死因子
async presentAlert() {
const alert = await this.alertController.create({
header: 'Input wifi information',
buttons: [
{
text: 'Ok',
handler: (alertData) => {
this.data = alertData.ssid+","+alertData.pw+","+alertData.email;
this.wifiName=alertData.ssid;
this.wifiPassword=alertData.pw;
this.email=alertData.email;
}
}
]
【问题讨论】:
-
你能分享你的代码吗?
-
请提供足够的代码,以便其他人可以更好地理解或重现该问题。
标签: javascript angularjs ionic-framework input inputbox