src/composables/formConfirm.js
@@ -1,4 +1,4 @@
import { defineProps, onActivated, onDeactivated, ref, watch } from 'vue';
import { defineProps, onActivated, onDeactivated, reactive, ref, watch } from 'vue';
import { useCloned } from '@vueuse/core';
import { useMessageBoxTip, useMessageBox } from './messageBox';
@@ -13,7 +13,7 @@
  },
  reset = {
    do: () => {}
  }
  },
}) {
  if (!submit.title) submit.title = '提交';
  if (!submit.msg) submit.msg = '确认是否提交?';
@@ -92,9 +92,10 @@
  };
  // 提交表单
  const onSubmit = function () {
    formRef.value.validate((valid) => {
  const onSubmit = function (messageBox = true) {
    formRef.value.validate(async (valid) => {
      if (valid) {
        if (messageBox) {
        useMessageBoxTip({
          confirmMsg: submit.msg,
          confirmTitle: submit.title,
@@ -104,6 +105,10 @@
            return res;
          }
        });
        } else {
          await submit.do();
          submited();
        }
      }
    });
  };