点击无效
解决办法:
可以使用 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
input标签一般不用click时间,如果是聚焦使用focus事件,失去焦点使用blur事件进行触发
VUE中直接在标签中写@click事件时,等号右边的函数会默认为是vm对象的一个方法,因此会在js中寻找_vm.alert方法,找不到会报以下错误
Property or method "alert" is not defined on the instance but referenced during render
,正确做法应为@focus = "doSomething",在js方法中再定义doSomething的功能