--- order: 3.1 title: zh-CN: 表单禁用 en-US: Form disabled --- ## zh-CN 设置表单组件禁用,仅对 antd 组件有效。 ## en-US Set component disabled, only works for antd components. ```tsx import React, { useState } from 'react'; import { Form, Input, Button, Radio, Select, Cascader, DatePicker, InputNumber, TreeSelect, Switch, Checkbox, } from 'antd'; const { RangePicker } = DatePicker; const { TextArea } = Input; const FormDisabledDemo = () => { const [componentDisabled, setComponentDisabled] = useState(true); const onFormLayoutChange = ({ disabled }: { disabled: boolean }) => { setComponentDisabled(disabled); }; return (
disabled Apple Pear