el-input 视图不刷新或者视图刷寻之后值没有更新

标签:table   error   max   width   不能   erro   alt   tab   表格   

背景:

技术图片

el-table表格循环的数据,本次发货数量不能大于剩余数量,如果大于剩余数量就默认变为剩余数量

HTML代码:

      <el-table-column prop="skuDeliveryNum" align="center" label="本次发货数量" min-width="110">
                            <template slot-scope="scope">
                                <el-input maxlength="50" v-model="scope.row.skuDeliveryNum" placeholder="请输入" :max="scope.row.skuLeftNum"
                                    @blur="changeNun(scope.row)"
                                    @input="scope.row.skuDeliveryNum = scope.row.skuDeliveryNum.replace(/[^0-9]/g, ‘‘);">  
                                </el-input>
                            </template>
                        </el-table-column>
@input="scope.row.skuDeliveryNum = scope.row.skuDeliveryNum.replace(/[^0-9]/g, ‘‘);"> 
 不允许输入数字以外的字符
//发货数量判断
            changeNun(num) {
                if (event.target.value > num.skuLeftNum) {
                    this.$nextTick(()=>{
                        num.skuDeliveryNum = num.skuLeftNum
                    })
                    this.$message.error(‘发货数量不能大于剩余数量‘);
                } else if (event.target.value == ‘‘ || event.target.value == null) {
                    this.$nextTick(()=>{
                        num.skuDeliveryNum = 1
                    })
                }
            },
 
  this.$nextTick(()=>{  })   
  //用这个方法去刷新视图和数据

el-input 视图不刷新或者视图刷寻之后值没有更新

标签:table   error   max   width   不能   erro   alt   tab   表格   

原文地址:https://www.cnblogs.com/lidonglin/p/14119945.html

版权声明:完美者 发表于 2020-12-16 12:44:23。
转载请注明:el-input 视图不刷新或者视图刷寻之后值没有更新 | 完美导航

暂无评论

暂无评论...