【问题标题】:vue.js input function call | Samsung s9 device | function not callingvue.js 输入函数调用 |三星s9设备|函数不调用
【发布时间】:2020-08-20 15:46:22
【问题描述】:

场景是在输入 3 个字符后调用函数。它适用于台式机和其他设备。但在三星设备中它不起作用。它在进入空间或关闭移动键盘后工作。 我的期望是:函数应该在输入 3 个字符后调用 下面是.vue文件

<input id="searchInput" v-model="searchString" @input="searchString.length>=3 && showSearchResults($event)" @keyup="searchString.length>=3 && showSearchResults($event)">

下面是js文件

showSearchResults {
  // some function here
}

【问题讨论】:

    标签: android vue.js samsung-mobile samsung-galaxy


    【解决方案1】:

    您是否尝试过检查函数内部的长度?

    <input id="searchInput" v-model="searchString" @input='onInput'">
    
    methods: {
      onInput(value) {
        // if length less than 3 do nothing
        if(value.length <=3) return
        enter code here
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2018-03-29
      • 1970-01-01
      • 1970-01-01
      • 2015-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-02
      • 1970-01-01
      相关资源
      最近更新 更多