p***@163.com
p***@163.com
  • 发布:2023-09-25 16:02
  • 更新:2023-12-26 16:15
  • 阅读:322

【报Bug】input输入数字过快会闪烁,删除太快删一半又会显示出来

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 11

HBuilderX类型: 正式

HBuilderX版本号: 3.8.7

手机系统: Android

手机系统版本号: Android 12

手机厂商: 华为

手机机型: 红米note11tpro

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:
<uni-tr> <uni-td align="center">宽(cm)</uni-td> <uni-td align="center"> <u-input v-model="item.width" type="number" placeholder="请输入宽度" @blur="updataTable(index,1,item.width)" :disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)" v-if="item.width!=''"></u-input> <u-input type="number" placeholder="请输入宽度" v-else @blur="updataTable(index,1,item.width)" disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)"></u-input>
</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">高(cm)</uni-td>
<uni-td align="center">
<u-input type="number" v-model="item.height" placeholder="请输入高度"
@blur="updataTable(index,2,item.height)" :disabled="item.isDefaultSizeUp=='N' || item.hei"
@focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"
v-if="item.height!=''"></u-input>
<u-input type="number" placeholder="请输入高度" v-else @blur="updataTable(index,2,item.height)" disabled="item.isDefaultSizeUp=='N' || item.hei" @focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"></u-input>
</uni-td>
</uni-tr>

预期结果:
<uni-tr> <uni-td align="center">宽(cm)</uni-td> <uni-td align="center"> <u-input v-model="item.width" type="number" placeholder="请输入宽度" @blur="updataTable(index,1,item.width)" :disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)" v-if="item.width!=''"></u-input> <u-input type="number" placeholder="请输入宽度" v-else @blur="updataTable(index,1,item.width)" disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)"></u-input>
</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">高(cm)</uni-td>
<uni-td align="center">
<u-input type="number" v-model="item.height" placeholder="请输入高度"
@blur="updataTable(index,2,item.height)" :disabled="item.isDefaultSizeUp=='N' || item.hei"
@focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"
v-if="item.height!=''"></u-input>
<u-input type="number" placeholder="请输入高度" v-else @blur="updataTable(index,2,item.height)" disabled="item.isDefaultSizeUp=='N' || item.hei" @focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"></u-input>
</uni-td>
</uni-tr>

实际结果:
<uni-tr> <uni-td align="center">宽(cm)</uni-td> <uni-td align="center"> <u-input v-model="item.width" type="number" placeholder="请输入宽度" @blur="updataTable(index,1,item.width)" :disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)" v-if="item.width!=''"></u-input> <u-input type="number" placeholder="请输入宽度" v-else @blur="updataTable(index,1,item.width)" disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)"></u-input>
</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">高(cm)</uni-td>
<uni-td align="center">
<u-input type="number" v-model="item.height" placeholder="请输入高度"
@blur="updataTable(index,2,item.height)" :disabled="item.isDefaultSizeUp=='N' || item.hei"
@focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"
v-if="item.height!=''"></u-input>
<u-input type="number" placeholder="请输入高度" v-else @blur="updataTable(index,2,item.height)" disabled="item.isDefaultSizeUp=='N' || item.hei" @focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"></u-input>
</uni-td>
</uni-tr>

bug描述:

<uni-tr> <uni-td align="center">宽(cm)</uni-td> <uni-td align="center"> <u-input v-model="item.width" type="number" placeholder="请输入宽度" @blur="updataTable(index,1,item.width)" :disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)" v-if="item.width!=''"></u-input> <u-input type="number" placeholder="请输入宽度" v-else @blur="updataTable(index,1,item.width)" disabled="item.isDefaultSizeUp=='N' || item.wid " @focus="getFocus(item.width,'width',index)" @input="getInput($event,index)"></u-input>
</uni-td>
</uni-tr>
<uni-tr>
<uni-td align="center">高(cm)</uni-td>
<uni-td align="center">
<u-input type="number" v-model="item.height" placeholder="请输入高度"
@blur="updataTable(index,2,item.height)" :disabled="item.isDefaultSizeUp=='N' || item.hei"
@focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"
v-if="item.height!=''"></u-input>
<u-input type="number" placeholder="请输入高度" v-else @blur="updataTable(index,2,item.height)" disabled="item.isDefaultSizeUp=='N' || item.hei" @focus="getFocus(item.height,'height',index)" @input="getInput2($event,index)"></u-input>
</uni-td>
</uni-tr>
2023-09-25 16:02 负责人:无 分享
已邀请:
p***@163.com

p***@163.com (作者)

什么时候才能解决这个bug,太恼火了

  • 风之源

    不用v-model试试,用@blur更新

    2023-09-25 16:11

  • p***@163.com (作者)

    回复 风之源: 不用v-model我没法赋值,业务需求input框的值是可以输入可以赋值的

    2023-09-25 16:18

z***@163.com

z***@163.com

这个问题几年都有了,目前还有

喜欢技术的前端

喜欢技术的前端 - QQ---445849201

如果 getInput2 有赋值可以在$nextTick 里面
this.$nextTick(()=>{

})

要回复问题请先登录注册