Skip to content

Commit cdac96b

Browse files
committed
fix: add form onSubmit prop
1 parent 4e4b9d6 commit cdac96b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/form/Form.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const FormProps = {
5757
validateOnRuleChange: PropTypes.looseBool,
5858
// 提交失败自动滚动到第一个错误字段
5959
scrollToFirstError: PropTypes.looseBool,
60+
onSubmit: PropTypes.func,
6061
onFinish: PropTypes.func,
6162
onFinishFailed: PropTypes.func,
6263
name: PropTypes.string,
@@ -276,7 +277,7 @@ const Form = defineComponent({
276277
const { prefixCls: customizePrefixCls, hideRequiredMark, layout, handleSubmit } = this;
277278
const getPrefixCls = this.configProvider.getPrefixCls;
278279
const prefixCls = getPrefixCls('form', customizePrefixCls);
279-
const { class: className, onSubmit: originSubmit, ...restProps } = this.$attrs;
280+
const { class: className, ...restProps } = this.$attrs;
280281

281282
const formClassName = classNames(prefixCls, className, {
282283
[`${prefixCls}-horizontal`]: layout === 'horizontal',

0 commit comments

Comments
 (0)