knt-shared 1.1.6 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -192,11 +192,23 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
192
192
  const handleSubmit = async (data) => {
193
193
  try {
194
194
  submitLoading.value = true;
195
+ if (!data) {
196
+ try {
197
+ await validate();
198
+ const values = getFieldsValue();
199
+ emit("submit", values);
200
+ return values;
201
+ } catch (error) {
202
+ console.warn("表单验证失败:", error);
203
+ throw error;
204
+ }
205
+ }
195
206
  if (data.errors) {
196
207
  console.warn("表单验证失败:", data.errors);
197
208
  return;
198
209
  }
199
210
  emit("submit", data.values);
211
+ return data.values;
200
212
  } finally {
201
213
  submitLoading.value = false;
202
214
  }