帖子
帖子
用户
博客
课程
12下一页
返回列表 发新帖
显示全部楼层
35
帖子
2
勋章
366
Y币

[其他] input ios change监听无效

[复制链接]
发表于 2022-7-22 13:36:49
ios input change事件无效 android 有效,有什么解决方案吗
<input class="f-input" type="password" v-model="valuePassword"
                    :placeholder="placeholderPassword" onchange="watchValue"></input>


380
帖子
4
勋章
6
Y币
能发一页简单测试代码吗, 这个应该都有效的
35
帖子
2
勋章
366
Y币
  1. <template>
  2.         <view class="">
  3.                 <view class="form">
  4.                         <view class="f-logo">
  5.                                 <img src="../../images/common/logo.png" alt="" style="width:140px" mode="widthFix">
  6.                         </view>
  7.                         <view class="f-input-box input-phone">
  8.                                         <img src="../../images/login/phone@2x.png" alt="" style="width:24px" mode="widthFix">
  9.                                         <input class="f-input" type="number" keyboard-type="number" maxlength="11"
  10.                                         :placeholder="placeholderPhone" v-model="valuePhone" onchange="watchValue"></input>
  11.                         </view>
  12.                         <view class="f-input-box">
  13.                                 <img src="../../images/login/pwd@2x.png" alt="" style="width:24px" mode="widthFix">
  14.                                 <input class="f-input" type="password" v-model="valuePassword"
  15.                                         :placeholder="placeholderPassword" onchange="watchValue" ></input>
  16.                         </view>
  17.                        
  18.                         <view class="btn-login">
  19.                          <!-- :disabled="!isTrue" -->
  20.                                 <button :class="isTrue?'btn-login-text-on':'btn-login-text'">登录</button>
  21.                         </view>
  22.                        
  23.                 </view>

  24.         </view>
  25. </template>
  26. <script>

  27. export default {
  28.         name: 'hoc-login-form-lr',
  29.         apiready() {//like created

  30.         },
  31.         props: {
  32.                 data: {
  33.                         type: Object,
  34.                         default: function () {
  35.                                 return {}
  36.                         }
  37.                 }
  38.         },
  39.         data() {
  40.                 return {
  41.                                 placeholderPhone: "请输入手机号",
  42.                                 valuePhone: "",
  43.                                 placeholderPassword: "请输入密码",
  44.                                 valuePassword: "",
  45.                                 isTrue:false
  46.                 }
  47.         },
  48.         apiready(){
  49.                
  50.         },
  51.         methods: {
  52.                
  53.                 watchValue(){
  54.                         // api.toast({
  55.                         //         msg:'1111'
  56.                         // })
  57.                         if(this.valuePhone && this.valuePassword){
  58.                                 this.isTrue = true
  59.                         }else{
  60.                                 this.isTrue = false
  61.                         }
  62.                 },

  63.                
  64.         }
  65. }

  66. </script>
  67. <style>
  68. .form {
  69.         margin-top: -30px;
  70.         font-size: 14px;
  71.         border-radius: 30px 30px 0 0;
  72.         background-color: #fff;
  73.         padding: 30px 30px 0;
  74. }
  75. .f-logo{
  76.         /* justify-content: flex-start; */
  77.         align-items: flex-end;
  78. }
  79. .f-input-box{
  80.         flex-direction: row;
  81.         justify-content: space-between;
  82.         align-items: center;
  83.         border-bottom: 1px solid #efefef;
  84.         margin-top: 20px;
  85. }
  86. .f-input {
  87.         /* margin-top: 20px; */
  88.         width: 90%;
  89.         height: 40px;
  90.         box-sizing: border-box;
  91.         border: none;
  92.         background-color: #fff;
  93.         color: #333;
  94. }



  95. .btn-login {
  96.         margin-top: 20px;
  97.         width: 100%;
  98.         height: 46px;
  99.         border-radius: 4px;
  100.         /* background: #17b998; */
  101.         justify-content: center;
  102.         align-items: center;
  103.         color: #fff;
  104. }
  105. .btn-login-text {
  106.         font-size: 15px;
  107.         color: #fff;
  108.         width: 100%;
  109.         background-color: #CCCCCC;
  110.         border-radius: 50px 50px;
  111.         height: 50px;
  112.         /* #FC800E */
  113. }
  114. .btn-login-text-on{
  115.         font-size: 15px;
  116.         color: #fff;
  117.         width: 100%;
  118.         border-radius: 50px 50px;
  119.         height: 50px;
  120.         background-color: #FC800E;
  121. }
  122. .btn-other {
  123.         flex-direction: row;
  124.         justify-content: space-between;
  125. }
  126. .btn-other-text {
  127.         margin-top: 10px;
  128.         font-size: 14px;
  129.         color: #2F78CE;
  130. }
  131. .btn-other-text-1{
  132.         margin-top: 10px;
  133.         font-size: 14px;
  134.         color: #333;
  135. }

  136. </style>
复制代码
380
帖子
4
勋章
6
Y币
oninput  ="watchValue"

这样就可以了
35
帖子
2
勋章
366
Y币
oninput input type =“password” 时用的v-model绑定,会出现第一次输入没值,第二次输入才有
技术咨询-F · 2022-7-22 15:39oninput  ="watchValue"

这样就可以了
380
帖子
4
勋章
6
Y币
Android  还是 iOS? 都一样吗?
BIP205126 · 2022-7-22 16:24oninput input type =“password” 时用的v-model绑定,会出现第一次输入没值,第二次输入才有
35
帖子
2
勋章
366
Y币
ios跟安卓都一样
380
帖子
4
勋章
6
Y币
我这测试可以
BIP205126 · 2022-7-22 16:53ios跟安卓都一样
35
帖子
2
勋章
366
Y币
发的代码里那个istrue来回触发刷新按钮的颜色的时候会出现这个问题
380
帖子
4
勋章
6
Y币
是这样,已反馈给相关技术排查
BIP205126 · 2022-7-22 17:26发的代码里那个istrue来回触发刷新按钮的颜色的时候会出现这个问题
12下一页
您需要登录后才可以回帖 登录

本版积分规则