taro Input,TextArea组件使用value进行双向绑定。快速输入跟快速删除时value会闪烁

7jmck4yq  于 4个月前  发布在  其他
关注(0)|答案(4)|浏览(66)

相关平台

京东小程序

小程序基础库: 2.4.0
使用框架: Vue 3

复现步骤

<input
:value="stateValue"
@input="onInput"
/>

const onInput = (e) => {
stateValue = e.detail.value;
}

期望结果

希望能准确展示value值。不闪烁 不显示旧的value

实际结果

快速输入跟删除会闪烁,闪现旧的value

环境信息

👽 Taro v3.6.5

  Taro CLI 3.6.5 environment info:
    System:
      OS: Windows 10 10.0.19045
    Binaries:
      Node: 14.18.2 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
      npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.5 => 3.6.5
      @tarojs/components: 3.6.5 => 3.6.5
      @tarojs/helper: 3.6.5 => 3.6.5
      @tarojs/plugin-framework-vue3: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-alipay: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-h5: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-jd: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-qq: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-swan: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-tt: 3.6.5 => 3.6.5
      @tarojs/plugin-platform-weapp: 3.6.5 => 3.6.5
      @tarojs/router: 3.6.5 => 3.6.5
      @tarojs/runtime: 3.6.5 => 3.6.5
      @tarojs/shared: 3.6.5 => 3.6.5
      @tarojs/taro: 3.6.5 => 3.6.5
      @tarojs/taro-h5: 3.6.5 => 3.6.5
      @tarojs/taro-loader: 3.6.5 => 3.6.5
      @tarojs/webpack5-runner: 3.6.5 => 3.6.5
      babel-preset-taro: 3.6.5 => 3.6.5
      eslint-config-taro: 3.6.5 => 3.6.5

补充信息

升级taro的最新版本v3.6.7后还是能复现这个问题

evrscar2

evrscar21#

846ead27e0aacf00599baf601b29e127_4.mp4

zxlwwiss

zxlwwiss2#

stateValue = e.detail.value;

加个防抖

q5iwbnjs

q5iwbnjs3#

CustomWrapper包裹一下啊

ia2d9nvy

ia2d9nvy4#

我也用同样的问题,在性能比较差的机子上特别明显

相关问题