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.esm.js CHANGED
@@ -190,11 +190,23 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
190
190
  const handleSubmit = async (data) => {
191
191
  try {
192
192
  submitLoading.value = true;
193
+ if (!data) {
194
+ try {
195
+ await validate();
196
+ const values = getFieldsValue();
197
+ emit("submit", values);
198
+ return values;
199
+ } catch (error) {
200
+ console.warn("表单验证失败:", error);
201
+ throw error;
202
+ }
203
+ }
193
204
  if (data.errors) {
194
205
  console.warn("表单验证失败:", data.errors);
195
206
  return;
196
207
  }
197
208
  emit("submit", data.values);
209
+ return data.values;
198
210
  } finally {
199
211
  submitLoading.value = false;
200
212
  }