防重提交
<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; } }) },