<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)
              }
            },
Logo

前往低代码交流专区

更多推荐