[随笔] uni-app @input监听输入 @blur触发失去焦点事件 额外传参

  • page
<input type="digit" placeholder="请输入金额" @input="inputAmount($event,index,item,'S')" @blur="Listeningfocus('S',index)" v-model="item.sutotal" />
  • js
//输入金额
   inputAmount(e,index,item,type){
    var that = this
    if(type == 'S') {
     this.$set(this.circulationMoneyList[index],'sutotal',e.detail.value)
    }
   },
   //失去焦点触发  
   Listeningfocus(type,index){
      if(type == 'S'){
         this.circulationMoneyList[index].denomination = xxx;
      }
   }

你可能感兴趣的:(uni-app&微信小程序,javascript,前端)