离子输入提出自动创建问题(Ionic Input filed auto create issue)

编程入门 行业动态 更新时间:2024-10-16 02:23:22
离子输入提出自动创建问题(Ionic Input filed auto create issue)

林使用Ionic 3为我的移动应用程序,我试图创建时,我想在自动创建下一个字段后输入字段上的东西,但它不适合我,任何人都知道如何正确地做到这一点

HTML

<ion-input type="text" placeholder="name" right (keyup.enter)="nextfiled()" ></ion-input>

.TS

nextfiled(value: string): void { alert('Submitted value: ' + value); }

Im used Ionic 3 for a my mobile application, Im tried to create when I type something on the input filed after want to auto create next filed , but its not work for me, anyone know how to do that correctly

html

<ion-input type="text" placeholder="name" right (keyup.enter)="nextfiled()" ></ion-input>

.ts

nextfiled(value: string): void { alert('Submitted value: ' + value); }

最满意答案

尝试这个:

html的

<ion-item *ngFor="let item of textBox"> <ion-input type="text" placeholder="name" [(ngModel)]="item.one" (keypress)="addTextBox($event.keyCode)"></ion-input> </ion-item>

.TS

textBox:any = [{one:''}]; addTextBox(ev){ console.log('isScroll',ev); if (ev == 13) { this.textBox.push({one:''}); } }

Try this:

.html

<ion-item *ngFor="let item of textBox"> <ion-input type="text" placeholder="name" [(ngModel)]="item.one" (keypress)="addTextBox($event.keyCode)"></ion-input> </ion-item>

.ts

textBox:any = [{one:''}]; addTextBox(ev){ console.log('isScroll',ev); if (ev == 13) { this.textBox.push({one:''}); } }

更多推荐

type,value,Ionic,create,nextfiled,电脑培训,计算机培训,IT培训"/> <meta name=&

本文发布于:2023-08-02 07:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1373059.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:离子   Input   Ionic   filed   create

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!