zoukankan      html  css  js  c++  java
  • js获取input 的值 event

     使用  event.target.value 来获取input 的值
    HTML
     
    <el-table-column prop="purchaseDemandProdetailReplace2DTO.purchaseNumber" label="换货数量"  min-width="100">
           <template slot-scope="scope">
                  <el-input v-model="scope.row.purchaseNumber"
                              @blur="changeNun(event,scope.row)"
                                @input="scope.row.purchaseNumber = scope.row.purchaseNumber.replace(/[^0-9]/g, '');">  //只允许数组数字,输入其他的则为空
                  </el-input>
           </template>
      </el-table-column>
     
    js 
     
    changeNun($event,num){
           console.log(event.target.value,num.purchaseNumber)  //event接收的时候要写成$event , 不然拿不到input的值
           if(event.target.value>num.purchaseNumber){
           event.target.value = num.purchaseNumber
                    this.$message.error('换货数量不能大于未交货订单数量!');
           }else if(event.target.value == '' || event.target.value == null){
                   event.target.value = 0
                }
           }
  • 相关阅读:
    线性反馈系统
    静磁场
    平面波的传播
    Partition does not end on cylinder boundary
    FFTW简介及使用
    EINTR、ERESTARTSYS和SIGINT
    凉面
    linux Shell编程
    Linux From Scratch [2]
    Linux From Scratch [1]
  • 原文地址:https://www.cnblogs.com/lidonglin/p/14005849.html
Copyright © 2011-2022 走看看