帖子
帖子
用户
博客
课程
显示全部楼层
22
帖子
0
勋章
162
Y币

[BUG] 在 avm input oninput中修改this.data输入被阻断

[复制链接]
发表于 2021-11-13 13:08:58

input绑定v-model ,并在oninput中修改data,会发生阻断,代码如下
<template>
  <scroll-view class="main" scroll-y>
    <safe-area></safe-area>
    <input v-model="password1" oninput="oninput"></input>
  </scroll-view>
</template>
<script>
import './test-com.stml'
export default {
  name: 'test',
  data() {
    return {
      password1: "",
      aaa:""
    }
  },
  methods:{
    oninput(e) {
      console.log(JSON.stringify(e.detail.value));
      if(e.detail.value.length>=2){
        this.data.aaa = "222";
      }
    }
  }
}
</script>



380
帖子
4
勋章
6
Y币
this.data.password1 = "222";

没阻断吧
22
帖子
0
勋章
162
Y币
我放的代码,原封不动,运行,然后,输入123,你会发现只有12
技术支持-F · 2021-11-15 17:24this.data.password1 = "222";

没阻断吧
380
帖子
4
勋章
6
Y币
已提交给相关技术
您需要登录后才可以回帖 登录

本版积分规则