> 注：没找到比较通用的 tab 样式，这里并没有对 tab 做过多样式的封装，后续可以进行添加

#### 基本使用

最单纯的 Tab,可以切换各选项卡的内容

```js
<Tab>
  <TabPanel header="告警明细" keys="1">
    111
  </TabPanel>
  <TabPanel header="告警不明细" keys="2">
    222
  </TabPanel>
</Tab>
```

#### ~~~定制 tabBar~~~

可直接通过 css-module 自定义样式，详见[Startup](/#startup)

~~~通过 header 返回节点，定制 tabBar 的内容,通过 style 等定制样式~~~

```js
<Tab
  tabStyle={{ color: "blue", marginRight: "10px" }}
  activeStyle={{ color: "red", borderColor: "orange" }}
>
  <TabPanel header="告警明细" keys="1">
    111
  </TabPanel>
  <TabPanel header={<div>❤️可疑活动明细</div>} keys="2">
    222
  </TabPanel>
</Tab>
```

#### 整合 Code 组件，进行代码展示

定制 tab 样式和内容，进行常用的 code 展示 tab

```js
const code = {
  "@timestamp": "2017-12-27T19:38:39+08:00",
  input_name: "sensor_input",
  input_type: "sensor",
  data: "10.10.169.184",
  data_type: "ip",
  behave_uuid: "sensor-1273069213273718",
  input_uuid: "1514374719-sensor-93579900-80545624",
  machine: "10.9.154.22",
  time: 1514374719,
  input_time: 1514374719,
  related_ip: "10.10.169.184",
  source_ip: "10.9.154.22",
  event_type: "net",
  net: {
    src_ip: "10.9.154.22",
    src_port: 42065,
    dest_ip: "10.10.169.184",
    dest_port: 1514,
    proto: "UDP",
    type: "flow",
    flow: {
      app_proto: "failed",
      pkts_toserver: 1,
      bytes_toserver: 478,
      state: "new"
    }
  }
};
const tabStyle = {
  backgroundColor: "#e8e8e8",
  color: "#1b3247",
  fontSize: "14px",
  border: "none",
  width: "90px",
  textAlign: "center",
  fontWeight: "normal",
  height: "30px",
  lineHeight: "30px",
  padding: 0
};
const activeStyle = {
  backgroundColor: "#394045",
  color: "#fff"
};
<Tab tabStyle={tabStyle} activeStyle={activeStyle}>
  <TabPanel header="表格" keys="table">
    <Code data={code} />
  </TabPanel>
  <TabPanel header="JSON" keys="json">
    <Code data={code} type="json" />
  </TabPanel>
</Tab>;
```

#changeLog
1, 增加 isTrapezoid, 当 isTrapezoid 为 true, 展示如图![3.gif](https://upload-images.jianshu.io/upload_images/4432476-63e3f671351ea4b7.gif?imageMogr2/auto-orient/strip)
