@input事件 ,当键盘输入时,触发input事件,event.detail = {value}
场景
@input
事件想要传递一个参数到方法中 但是同时还要保留原来返回的event
解决方法:$event
@input="onKeyInput($event,123)"
运用
<view class="item" v-for="(item,index) in PickedList" :key="index">
<view class="itemTop">
<view class="left">
<text>网点名称:{{item.service_branch.company_name}}</text>
<text>网点编号:{{item.service_branch.company_id}}</text>
<!-- <text>规格:{{item.goods_spec.specs}}</text> -->
<text>说明:{{item.goods_spec.description}}</text>
</view>
<view class="right">
<view class="mainBox-model-countBox-modelinfo-count">
<view class="margin-top" @click="operation(item,index,1)">-</view>
<input class="mainBox-model-countBox-modelinfo-countInput" type="number" v-model.number="item.count < 0 ? 0 : item.count"
:disabled="false" @input="countInput($event,index)"/>
<view class="margin-top" @click="operation(item,index,2)">+</view>
</view>
</view>
</view>
<view class="btns">
<tui-button width="220rpx" height="84rpx" type="green " @click="Dayin(item.id,item.count,index)" :disabled="printBtnStatus">打印标签</tui-button>
<tui-button width="220rpx" height="84rpx" @click="edit(item.id,item.count,index)">确认修改</tui-button>
</view>
</view>
// 输入数字实时监听
countInput(e,index){
let _this = this;
console.log(e.detail.value); //输入的值
console.log(index); //传参
_this.PickedList[index].count = e.detail.value;
}