--- order: 5 title: zh-CN: 多层抽屉 en-US: Multi-level drawer --- ## zh-CN 在抽屉内打开新的抽屉,用以解决多分支任务的复杂状况。 ## en-US Open a new drawer on top of an existing drawer to handle multi branch tasks ```jsx import { Drawer, List, Form, Button, Input, Tag } from 'antd'; const vegetables = ['asparagus', 'bamboo', 'potato', 'carrot', 'cilantro', 'potato', 'eggplant']; const TagList = ({ value, show }) => { return (
{value.map(item => {item})} show()}>+
); }; class DrawerForm extends React.Component { state = { visible: false, childrenDrawer: false }; showDrawer = () => { this.setState({ visible: true, }); }; onClose = () => { this.setState({ visible: false, }); }; showChildrenDrawer = () => { this.setState({ childrenDrawer: true, }); }; onChildrenDrawerClose = () => { this.setState({ childrenDrawer: false, }); }; render() { const { getFieldDecorator } = this.props.form; return (
{getFieldDecorator('name', { rules: [{ required: true, message: 'please enter cookbook name' }], })()} {getFieldDecorator('Food', { rules: [{ required: true, message: 'please enter food' }], initialValue: ['potato', 'eggplant'], })()}
Vegetables
} dataSource={vegetables} renderItem={item => {item}} />
); } } const App = Form.create()(DrawerForm); ReactDOM.render(, mountNode); ```