---
order: 11
title:
zh-CN: 受控面板
en-US: Controlled Panels
---
## zh-CN
通过组合 `mode` 与 `onPanelChange` 控制要展示的面板。
## en-US
Determing which panel to show with `mode` and `onPanelChange`.
```jsx
import { DatePicker } from 'antd';
const { RangePicker } = DatePicker;
class ControlledDatePicker extends React.Component {
state = { mode: 'time' };
handleOpenChange = open => {
if (open) {
this.setState({ mode: 'time' });
}
};
handlePanelChange = (value, mode) => {
this.setState({ mode });
};
render() {
return (