@jay.kou/rak-ssr
Version:
A react based UI components for admin system
49 lines • 1.53 kB
JavaScript
import { Button } from 'antd';
import { useRef } from 'react';
import { SchemaForm } from "../../..";
import { getColumns } from "./columns";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var Demo = function Demo() {
var formRef = useRef();
return /*#__PURE__*/_jsxs("div", {
children: [/*#__PURE__*/_jsx(SchemaForm, {
name: "demo-initial-value-basic",
formRef: formRef,
columns: getColumns(),
autoFocusFirstInput: false,
initialValues: {
showUser: 0
}
}), /*#__PURE__*/_jsxs("div", {
style: {
textAlign: 'end'
},
children: [/*#__PURE__*/_jsx(Button, {
"data-testid": "setbtn",
style: {
marginRight: '10px'
},
onClick: function onClick() {
var _formRef$current;
return (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.setFieldsValue({
showUser: 1,
user: '1'
});
},
children: "\u8D4B\u503C"
}), /*#__PURE__*/_jsx(Button, {
"data-testid": "resetbtn",
style: {
marginRight: '10px'
},
onClick: function onClick() {
var _formRef$current2;
return (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.resetFields();
},
children: "\u91CD\u7F6E"
})]
})]
});
};
export default Demo;