Skip to content

Commit 6ce295d

Browse files
committed
fix: remove form warning in some case #4531
1 parent baaccd5 commit 6ce295d

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

components/form/Form.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,16 @@ const Form = defineComponent({
318318
e.preventDefault();
319319
e.stopPropagation();
320320
emit('submit', e);
321-
const res = validateFields();
322-
res
323-
.then(values => {
324-
emit('finish', values);
325-
})
326-
.catch(errors => {
327-
handleFinishFailed(errors);
328-
});
321+
if (props.model) {
322+
const res = validateFields();
323+
res
324+
.then(values => {
325+
emit('finish', values);
326+
})
327+
.catch(errors => {
328+
handleFinishFailed(errors);
329+
});
330+
}
329331
};
330332

331333
expose({

0 commit comments

Comments
 (0)