首页 > cms建站系统 > element

input 点击事件无效 [Element Migrating][ElInput][Event]: click is removed.

发布时间:2022-9-21 08:45

点击无效


 


解决办法:


可以使用 v-on 的修饰符 .native。例如:

@click.native="getContentData(item)"
  <el-input v-for="(item,index) in voiceRetrievalData.oldContent"
                      :key="index"
                      v-model="item.sentence"
                      :ref="'input'+item.id"
                      placeholder="请输入内容"
                      @click.native="getContentData(item)"
            ></el-input>

参考:


https://segmentfault.com/q/1010000011579964


  1. input标签一般不用click时间,如果是聚焦使用focus事件,失去焦点使用blur事件进行触发

  2. VUE中直接在标签中写@click事件时,等号右边的函数会默认为是vm对象的一个方法,因此会在js中寻找_vm.alert方法,找不到会报以下错误Property or method "alert" is not defined on the instance but referenced during render,正确做法应为@focus = "doSomething",在js方法中再定义doSomething的功能



标签:[!--infotagslink--]

您可能感兴趣的文章: