From 030925486fb0d0403083ed6109943e7a7d05a0cd Mon Sep 17 00:00:00 2001 From: Barrior Date: Fri, 5 Jan 2024 11:54:56 +0800 Subject: [PATCH] docs(FormRender): improve documentation --- .../form-render-react/500-builtin-renderers.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/form-render-react/500-builtin-renderers.md b/examples/form-render-react/500-builtin-renderers.md index b2b7425..8cb7bfb 100644 --- a/examples/form-render-react/500-builtin-renderers.md +++ b/examples/form-render-react/500-builtin-renderers.md @@ -18,6 +18,7 @@ import * as styles from './styles' import schema from './schemas/all' const Demo = () => { + const [isDisabled, setIsDisabled] = useState(false) const [isReadonly, setIsReadonly] = useState(false) const [value, setValue] = useState({ Description: '纯展示的内容吧啦吧啦', @@ -25,13 +26,18 @@ const Demo = () => { const registerActions = useMemo(() => { return { + disable: () => ( + + ), readonly: () => ( ), } - }, [isReadonly]) + }, [isReadonly, isDisabled]) return (
@@ -41,8 +47,10 @@ const Demo = () => { schema={schema} value={value} onChange={setValue} - actions={['submit', 'reset', 'readonly']} + actions={['submit', 'reset', 'disable', 'readonly']} registerActions={registerActions} + // 是否禁用态 + disabled={isDisabled} // 是否只读状态 readonly={isReadonly} // 只读状态没有数据时的占位符