防重提交

 <avue-form 
      ref="obj" 
      v-model="obj" 
      :option="option"
      @reset-change='resetData'
      @submit='submit'>
</avue-form>
<div class="btn">
     <el-button class="el-icon-check" size="small" type="primary" @click="submitData('obj')" :disabled='canClick'> 提 交</el-button>
     <el-button class="el-icon-delete" size="small" @click="resetData" :disabled='canClick'> 返 回</el-button>
</div>
obj:{},
option:{
   emptyBtn: false,
   submitBtn: false,
}

 submit(obj,done){
    done();
 },
submitData:function(obj){
  this.$refs[obj].validate((valid) => {   if (valid) {   this.$refs[obj].submit();   }else{   return false;   } }) },

 

posted @ 2021-03-10 11:34  奔向太阳的向日葵  阅读(110)  评论(0编辑  收藏  举报