---
title: 多选项开关的基本用法
title_en: normal usage for multi switch component
category: 2
---
展示了一个表格组件的基本用法
```jsx
import MultiSwitch from '../index'

const dataSource = [{
  name: '一小时',
}, {
  name: '一周',
}, {
  name: '一个月',
}]


ReactDOM.render(
  <MultiSwitch
    dataSource={dataSource}
    onSwitch={(index, target) => {console.log(index)}}
  />,
  mountNode
)
```