需求
完成弹窗提交表格功能,在使用iview框架的modal组件时,遇到如下图问题,点击modal页脚的确认按钮提交表单,表单教验没通过,不关闭表单但底部确认按钮还是现实loading状态。

确认按钮点击事件
      addModalOk(name) {
        this.$refs[name].validate((valid) => {
          if (valid) {
            this.$Message.success('Success!');
            this.addModal = false;//关闭表单
          } else {
            this.$Message.error('Fail!');
            //主要代码
             this.loading = false;
             this.$nextTick(() => {
               this.loading = true;
             });
              //主要代码
          }
        })
      },
 

相关文章:

  • 2021-10-23
  • 2021-09-19
  • 2022-01-07
  • 2022-03-06
  • 2021-12-20
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-06-01
  • 2022-12-23
  • 2022-03-01
  • 2021-11-15
相关资源
相似解决方案