@ecoding/components.antd.layout
Advanced tools
@@ -14,4 +14,5 @@ import React from 'react'; | ||
| addonAfter?: React.ReactNode; | ||
| htmlType?: "button" | "submit" | "reset"; | ||
| } | ||
| declare const FixedButtonArea: React.FC<IProps>; | ||
| export default FixedButtonArea; |
| import React, { useCallback, useState } from 'react'; | ||
| import { Space, Button } from 'antd'; | ||
| const FixedButtonArea = ({ className, addonAfter, addonBefore, okType, onCancel, cancelText, onOkAfter, onOk, okText, hiddenCancel }) => { | ||
| const FixedButtonArea = ({ className, addonAfter, addonBefore, okType, onCancel, cancelText, onOkAfter, onOk, okText, hiddenCancel, htmlType }) => { | ||
| const [loading, setLoading] = useState(false); | ||
@@ -35,3 +35,3 @@ const cancel = useCallback(() => { | ||
| addonBefore || null, | ||
| React.createElement(Button, { key: "submit", type: okType, loading: loading, onClick: ok }, okText), | ||
| React.createElement(Button, { key: "submit", htmlType: htmlType, type: okType, loading: loading, onClick: ok }, okText), | ||
| addonAfter || null)))); | ||
@@ -43,4 +43,5 @@ }; | ||
| okType: 'primary', | ||
| hiddenCancel: true | ||
| hiddenCancel: true, | ||
| htmlType: "button" | ||
| }; | ||
| export default FixedButtonArea; |
+2
-2
| { | ||
| "name": "@ecoding/components.antd.layout", | ||
| "version": "0.0.19", | ||
| "version": "0.0.20", | ||
| "author": "cxc", | ||
@@ -26,3 +26,3 @@ "homepage": "", | ||
| }, | ||
| "gitHead": "6791f6ad4fbe3ba1fcae52e0e83a6b6a0ff6d94f" | ||
| "gitHead": "d70071f8ed2efa6df62ff1dcf2870eefec83e45c" | ||
| } |
11800
0.85%296
0.68%