素材巴巴 > 程序开发 >

【uni-app】input组件 @input事件(实时监听输入)传参问题

程序开发 2023-09-18 17:44:43

@input事件 ,当键盘输入时,触发input事件,event.detail = {value}


 

场景

@input事件想要传递一个参数到方法中 但是同时还要保留原来返回的event

解决方法:$event

@input="onKeyInput($event,123)"
 

运用

效果图:
在这里插入图片描述

网点名称:{{item.service_branch.company_name}}网点编号:{{item.service_branch.company_id}}说明:{{item.goods_spec.description}}-+打印标签确认修改
 
 
// 输入数字实时监听
 countInput(e,index){let _this = this;console.log(e.detail.value); //输入的值console.log(index); //传参_this.PickedList[index].count = e.detail.value;
 },
 

标签:

素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。