提交 abea09c6 authored 作者: 钟是志's avatar 钟是志

按钮组件增加 form 表单 props

上级 cc87e58f
...@@ -10,6 +10,7 @@ export default function ButtonDiy(props) { ...@@ -10,6 +10,7 @@ export default function ButtonDiy(props) {
const { const {
loading, loading,
onClick, onClick,
form,
...ev ...ev
} = props; } = props;
const [loadingThis, setLoading] = useState(false); const [loadingThis, setLoading] = useState(false);
...@@ -21,10 +22,9 @@ export default function ButtonDiy(props) { ...@@ -21,10 +22,9 @@ export default function ButtonDiy(props) {
const topOnClick = (e) => { const topOnClick = (e) => {
// console.log(e); // console.log(e);
if(onClick && typeof onClick === 'function'){ if(onClick && typeof onClick === 'function'){
return onClick(e, setLoading); return onClick(e, setLoading, form.getFieldsValue());
} }
}; };
return ( return (
<Button loading={loadingThis} <Button loading={loadingThis}
type="primary" type="primary"
......
...@@ -2674,7 +2674,7 @@ ${obj[dataColumn.base52]} ...@@ -2674,7 +2674,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />; cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} form={this.props.form}/>;
} }
} }
...@@ -2755,7 +2755,7 @@ ${obj[dataColumn.base52]} ...@@ -2755,7 +2755,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} />; cm = <ButtonDiy loading={this.props.loading} type="primary" {...ev} form={this.props.form}/>;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论