选择框的change事件执行两次
<avue-input v-model="newbusinessname" @change="changeBusinessname"type="tree" :dic="businessnameList"/>data() {return {a:'',newbusinessname:''...
·
<avue-input v-model="newbusinessname" @change="changeBusinessname" type="tree" :dic="businessnameList"/>
data() {
return {
a:'',
newbusinessname:'',
businessnameList:[],
}
}
changeBusinessname(){
this.$message.warning(this.businessname)
},
之前没做处理前,当change改变时,信息提示总是出现两次。后来在data里加个变量存储change值,然后方法里修改如下,顺利解决。
changeBusinessname(){
if(this.a==this.businessname){
}else{
this.a=this.businessname
//这里放change该执行的事件
this.$message.warning(this.businessname)
}
},
更多推荐
已为社区贡献6条内容
所有评论(0)