# 防重提交

提交后会禁止表单和按钮防止重复提交

#

submit中调用done方法和crud中使用一致

<avue-form :option="option" v-model="form" @submit="handleSubmit"></avue-form>
<script>
export default {
  data(){
    return {
       form:{
          text:'动态内容1'
       },
       option:{
          column: [{
              label: "用户名",
              prop: "username"
          }]
       }
    }
  },
  methods:{
    handleSubmit(form,done){
       this.$message.success('3s后关闭');
       setTimeout(()=>{
          done()
       },3000)
    }
  }
}
</script>

Expand Copy
Last Updated: 8/5/2021, 9:04:57 AM