sunmao-sdk
Version:
榫卯-开箱即用赋能-sdk
35 lines (31 loc) • 692 B
JavaScript
;
import React, { useState, useEffect } from "react";
import { Button } from "antd";
/**
* 表单按键组件
*/
const displayName = "FormBtn";
const FormBtn = props => {
const {
onChange,
name,
value,
schema: { commonProps = {} },
options: uiOptions,
formData,
rootValue,
...otherProps
} = props;
// 此处onClick与uiOptions中onClick会有冲突,自行注意,二选一
const { onClick } = commonProps;
return (
<Button
style={{ width: "100%" }}
onClick={() => onClick && onClick(formData, onChange, rootValue)}
{...uiOptions}
>
{value || "按键"}
</Button>
);
};
export default FormBtn;